clr commited on
Commit
5af0b29
·
verified ·
1 Parent(s): 7bc8c40

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -2
app.py CHANGED
@@ -51,6 +51,8 @@ def recfo(audio_file):
51
  chunk_output = pipe_fo(audio_file, chunk_length_s=4)['text']
52
  return (single_output, chunk_output)
53
 
 
 
54
 
55
  bl = gr.Blocks()
56
  with bl:
@@ -75,14 +77,20 @@ with bl:
75
  with gr.Tabs():
76
  with gr.TabItem("Icelandic"):
77
  with gr.Row():
 
78
  audio_file = gr.Audio(sources=["upload", "microphone"],type="filepath")
79
  with gr.Column():
80
  #whole_output = gr.Textbox(label="whole-file recognition")
81
  chunk_output = gr.Textbox(label="Wav2Vec2 recognition")# with chunking")
82
  whisper_output = gr.Textbox(label="Whisper recognition")
83
- text_button = gr.Button("Recognise Icelandic")
 
84
  #text_button.click(recis, inputs=audio_file, outputs=[whole_output,chunk_output])
85
- text_button.click(recis, inputs=audio_file, outputs=[chunk_output])
 
 
 
 
86
 
87
  with gr.TabItem("Faroese"):
88
  with gr.Row():
 
51
  chunk_output = pipe_fo(audio_file, chunk_length_s=4)['text']
52
  return (single_output, chunk_output)
53
 
54
+ def pick_asrc(au_src):
55
+ return gr.update(source=au_src)
56
 
57
  bl = gr.Blocks()
58
  with bl:
 
77
  with gr.Tabs():
78
  with gr.TabItem("Icelandic"):
79
  with gr.Row():
80
+ asrc = gr.Radio(["upload", "microphone"],value="upload",label="Audio input")
81
  audio_file = gr.Audio(sources=["upload", "microphone"],type="filepath")
82
  with gr.Column():
83
  #whole_output = gr.Textbox(label="whole-file recognition")
84
  chunk_output = gr.Textbox(label="Wav2Vec2 recognition")# with chunking")
85
  whisper_output = gr.Textbox(label="Whisper recognition")
86
+ w2v_button = gr.Button("Recognise Icelandic with Wav2Vec2")
87
+ whi_button = gr.Button("Recognise Icelandic with Whisper")
88
  #text_button.click(recis, inputs=audio_file, outputs=[whole_output,chunk_output])
89
+ w2v_button.click(recis, inputs=audio_file, outputs=[chunk_output])
90
+ #whi_button.click(recwhis, inputs=audio_file, outputs=[whisper_output])
91
+
92
+ asrc.change(pick_asrc,asrc,audio_file)
93
+
94
 
95
  with gr.TabItem("Faroese"):
96
  with gr.Row():