tykiww commited on
Commit
6b5ce4a
1 Parent(s): d25a92c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -8
app.py CHANGED
@@ -12,6 +12,13 @@ def process_meeting(audio_input, num_speakers, speaker_names):
12
  return answer
13
 
14
 
 
 
 
 
 
 
 
15
  def main(conf):
16
 
17
  with gr.Blocks(theme=gr.themes.Soft(text_size="lg")) as demo:
@@ -26,19 +33,20 @@ def main(conf):
26
  with gr.TabItem(conf["layout"]["page_names"][1]):
27
 
28
  audio_input = gr.Audio(type="filepath", label="Upload Audio File")
29
- num_speakers = gr.Number(label="Number of Speakers",
30
- value=2,
31
- precision=0,
32
- minimum=2,
33
- maximum=5)
34
  speaker_names = gr.Dataframe(
35
  label="Names and Additional Info",
36
  headers=["Name", "Supporting Details"],
37
  datatype=["str", "str"],
38
- row_count=(5,"dynamic"),
39
  col_count=(2, "fixed"),
40
  )
41
-
 
 
 
42
  process_button = gr.Button("Process")
43
  diarization_output = gr.Textbox(label="Diarization Output")
44
  label_file_link = gr.File(label="Download DAW Labels")
@@ -49,7 +57,7 @@ def main(conf):
49
  outputs=[diarization_output, label_file_link]
50
  )
51
 
52
- demo.launch()
53
 
54
 
55
 
 
12
  return answer
13
 
14
 
15
+ def update_table(num_speakers):
16
+ return gr.Dataframe(row_count=(num_speakers,"fixed")
17
+
18
+ def b_clicked(o):
19
+
20
+
21
+
22
  def main(conf):
23
 
24
  with gr.Blocks(theme=gr.themes.Soft(text_size="lg")) as demo:
 
33
  with gr.TabItem(conf["layout"]["page_names"][1]):
34
 
35
  audio_input = gr.Audio(type="filepath", label="Upload Audio File")
36
+ num_speakers = gr.Dropdown([2,3,4,5],
37
+ label="Number of Speakers",
38
+ value=2)
 
 
39
  speaker_names = gr.Dataframe(
40
  label="Names and Additional Info",
41
  headers=["Name", "Supporting Details"],
42
  datatype=["str", "str"],
43
+ row_count=(1,"fixed"),
44
  col_count=(2, "fixed"),
45
  )
46
+
47
+
48
+ speaker_names.change(fn=update_table,
49
+ )
50
  process_button = gr.Button("Process")
51
  diarization_output = gr.Textbox(label="Diarization Output")
52
  label_file_link = gr.File(label="Download DAW Labels")
 
57
  outputs=[diarization_output, label_file_link]
58
  )
59
 
60
+ demo.launch(server_name="0.0.0.0", allowed_paths=["/"])
61
 
62
 
63