futranbg commited on
Commit
3a0e917
1 Parent(s): a420981

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -13
app.py CHANGED
@@ -22,15 +22,12 @@ def s2t(audio, model_name):
22
  yield text
23
 
24
  with gr.Blocks() as demo:
25
- with gr.Row():
26
- with gr.Column():
27
- voice = gr.Audio(sources=["microphone"], type="filepath", label="Voice")
28
- voice.stop_recording(s2t, inputs=[voice, model_name], outputs=output)
29
- audio = gr.Audio(sources=["upload"], type="filepath", label="Audio file")
30
- audio.upload(s2t, inputs=[audio, model_name], outputs=output)
31
- model_name = gr.Dropdown(
32
- label="Models:",
33
- choices=[
34
  "openai/whisper-large-v3",
35
  "openai/whisper-large-v2",
36
  "openai/whisper-large",
@@ -39,9 +36,12 @@ with gr.Blocks() as demo:
39
  "openai/whisper-base",
40
  "openai/whisper-tiny",
41
  ],
42
- value="openai/whisper-large-v3",
43
- )
44
- with gr.Column():
45
- output = gr.Textbox(label="Transcription results")
 
 
 
46
 
47
  demo.queue().launch(max_threads=4)
 
22
  yield text
23
 
24
  with gr.Blocks() as demo:
25
+ with gr.Column():
26
+ voice = gr.Audio(sources=["microphone"], type="filepath", label="Voice")
27
+ audio = gr.Audio(sources=["upload"], type="filepath", label="Audio file")
28
+ model_name = gr.Dropdown(
29
+ label="Models:",
30
+ choices=[
 
 
 
31
  "openai/whisper-large-v3",
32
  "openai/whisper-large-v2",
33
  "openai/whisper-large",
 
36
  "openai/whisper-base",
37
  "openai/whisper-tiny",
38
  ],
39
+ value="openai/whisper-large-v3",
40
+ )
41
+ with gr.Column():
42
+ output = gr.Textbox(label="Transcription results")
43
+
44
+ voice.stop_recording(s2t, inputs=[voice, model_name], outputs=output)
45
+ audio.upload(s2t, inputs=[audio, model_name], outputs=output)
46
 
47
  demo.queue().launch(max_threads=4)