File size: 1,714 Bytes
adf1205
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c7523f4
 
 
d4dfd9a
c7523f4
d4dfd9a
 
adf1205
 
 
 
 
 
 
d4dfd9a
adf1205
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import gradio as gr
from utilities.setup import get_files
# import spaces


#@spaces.GPU
def process_meeting(audio_input, num_speakers, supporting_details):
    if 1 < num_speakers < 6:
        answer = "Completed Loading Data", "fl"
    else:
        answer = "Number of speakers out of range", "fl"
    return answer


def main(conf):

    with gr.Blocks(theme=gr.themes.Soft(text_size="lg")) as demo:
    
        with gr.TabItem(conf["layout"]["page_names"][0]):
            
            gr.Markdown("🎤 Non-Video Meeting Transcription and Speaker Diarization")
            gr.Markdown("![](file/microphone_pen_and_paper.jpeg)")
            gr.Markdown(get_files.load_markdown_file(conf["layout"]["about"]))
        

        with gr.TabItem(conf["layout"]["page_names"][1]):
            
            audio_input = gr.Audio(type="filepath", label="Upload Audio File")
            num_speakers = gr.Number(label="Number of Speakers", 
                         info="Please include ", 
                         value=2)
            with gr.Row():

                name_input = gr.Textbox(label="Speaker name")
                support_details = gr.Textbox(label="Speaker Details")
            
            process_button = gr.Button("Process")
            diarization_output = gr.Textbox(label="Diarization Output")
            label_file_link = gr.File(label="Download DAW Labels")
        
            process_button.click(
                fn=process_meeting,
                inputs=[audio_input, num_speakers, name_input, support_details],
                outputs=[diarization_output, label_file_link]
        )

    demo.launch()




if __name__ == "__main__":
    conf = get_files.json_cfg()
    main(conf)