Dinesh1102 commited on
Commit
e8a6903
·
1 Parent(s): 1accebe

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -13
app.py CHANGED
@@ -15,21 +15,16 @@ with gr.Blocks() as demo:
15
  """)
16
  with gr.Tab("Audio File"):
17
  with gr.Row().style(equal_height=True):
18
- audio_input1 = gr.Audio(label="Audio File", type="filepath")
19
- text_output1 = gr.Textbox(label="Transcribed text", show_label=True)
20
- file_button = gr.Button("Transcribe")
21
  with gr.Tab("Record"):
22
  with gr.Row().style(equal_height=True):
23
- audio_input2 = gr.Audio(label="Input Audio", source="microphone", type="filepath")
24
- text_output2 = gr.Textbox(label="Transcribed text", show_label=True)
25
  rec_button = gr.Button("Run")
26
- gr.HTML('''
27
- <div class="footer">
28
- <p>Model by <a href="https://github.com/openai/whisper" style="text-decoration: underline;" target="_blank">OpenAI</a></p>
29
- </div>
30
- ''')
31
-
32
- file_button.click(speech, inputs=audio_input1, outputs=text_output1)
33
- rec_button.click(speech, inputs=audio_input2, outputs=text_output2)
34
 
35
  demo.launch()
 
15
  """)
16
  with gr.Tab("Audio File"):
17
  with gr.Row().style(equal_height=True):
18
+ audio1 = gr.Audio(label="Audio File", type="filepath")
19
+ text1 = gr.Textbox(label="Transcribed text", show_label=True)
20
+ file_button = gr.Button("Run")
21
  with gr.Tab("Record"):
22
  with gr.Row().style(equal_height=True):
23
+ audio2 = gr.Audio(label="Input Audio", source="microphone", type="filepath")
24
+ text2 = gr.Textbox(label="Transcribed text", show_label=True)
25
  rec_button = gr.Button("Run")
26
+
27
+ file_button.click(speech, inputs=audio1, outputs=text1)
28
+ rec_button.click(speech, inputs=audio2, outputs=text2)
 
 
 
 
 
29
 
30
  demo.launch()