GreenRaptor commited on
Commit
9094213
·
1 Parent(s): 52394c1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -11
app.py CHANGED
@@ -88,19 +88,10 @@ with gr.Blocks(css=css) as demo:
88
 
89
  with gr.Row(elem_id="audio-container").style(mobile_collapse=False, equal_height=True):
90
  with gr.Column(scale=0.8):
91
- recorder = gr.Audio(source="microphone", type="filepath", show_label=False, visible=False).style(container=False)
92
-
93
- action_btn = gr.Button("Start recording...")
94
- def next_line(action, _):
95
- if action == 'Start':
96
- return {action_btn: 'Next', recorder: gr.update(visible=True)}
97
- else:
98
- return {action_btn: 'Done', recorder: gr.update(visible=False)}
99
-
100
  with gr.Column(scale=0.2, min_width=0):
101
- speech = gr.Button("Submit speech")
102
 
103
- action_btn.click(next_line, inputs=[action_btn, recorder], outputs=[action_btn, recorder])
104
  speech.click(transcribe, inputs=recorder, outputs=txt)
105
  txt.submit(user, [txt, chatbot], [txt, chatbot], queue=False).then(
106
  bot, chatbot, chatbot
 
88
 
89
  with gr.Row(elem_id="audio-container").style(mobile_collapse=False, equal_height=True):
90
  with gr.Column(scale=0.8):
91
+ recorder = gr.Audio(source="microphone", type="filepath", show_label=False, visible=False).style(container=False)
 
 
 
 
 
 
 
 
92
  with gr.Column(scale=0.2, min_width=0):
93
+ speech = gr.Button("Submit speech").style(height="auto")
94
 
 
95
  speech.click(transcribe, inputs=recorder, outputs=txt)
96
  txt.submit(user, [txt, chatbot], [txt, chatbot], queue=False).then(
97
  bot, chatbot, chatbot