tykiww commited on
Commit
adf1205
1 Parent(s): e20cc51

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +50 -0
app.py ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from utilities.setup import get_files
3
+ # import spaces
4
+
5
+
6
+ #@spaces.GPU
7
+ def process_meeting(audio_input, num_speakers, supporting_details):
8
+ if 1 < num_speakers < 6:
9
+ answer = "Completed Loading Data", "fl"
10
+ else:
11
+ answer = "Number of speakers out of range", "fl"
12
+ return answer
13
+
14
+
15
+ def main(conf):
16
+
17
+ with gr.Blocks(theme=gr.themes.Soft(text_size="lg")) as demo:
18
+
19
+ with gr.TabItem(conf["layout"]["page_names"][0]):
20
+
21
+ gr.Markdown("🎤 Non-Video Meeting Transcription and Speaker Diarization")
22
+ gr.Markdown("![](file/microphone_pen_and_paper.jpeg)")
23
+ gr.Markdown(get_files.load_markdown_file(conf["layout"]["about"]))
24
+
25
+
26
+ with gr.TabItem(conf["layout"]["page_names"][1]):
27
+
28
+ audio_input = gr.Audio(type="filepath", label="Upload Audio File")
29
+ num_speakers_input = gr.Number(label="Number of Speakers",
30
+ info="Please include ",
31
+ value=2)
32
+
33
+ process_button = gr.Button("Process")
34
+ diarization_output = gr.Textbox(label="Diarization Output")
35
+ label_file_link = gr.File(label="Download DAW Labels")
36
+
37
+ process_button.click(
38
+ fn=process_meeting,
39
+ inputs=[audio_input, num_speakers, supporting_details],
40
+ outputs=[diarization_output, label_file_link]
41
+ )
42
+
43
+ demo.launch()
44
+
45
+
46
+
47
+
48
+ if __name__ == "__main__":
49
+ conf = get_files.json_cfg()
50
+ main(conf)