csukuangfj commited on
Commit
27111fb
1 Parent(s): ee5f0e3

minor fixes

Browse files
Files changed (1) hide show
  1. app.py +38 -20
app.py CHANGED
@@ -210,6 +210,18 @@ def update_model_dropdown(language: str):
210
 
211
  demo = gr.Blocks(css=css)
212
 
 
 
 
 
 
 
 
 
 
 
 
 
213
  with demo:
214
  gr.Markdown(title)
215
  language_choices = list(language_to_models.keys())
@@ -256,6 +268,19 @@ with demo:
256
  uploaded_output = gr.Textbox(label="Recognized speech from uploaded file")
257
  uploaded_html_info = gr.HTML(label="Info")
258
 
 
 
 
 
 
 
 
 
 
 
 
 
 
259
  with gr.TabItem("Record from microphone"):
260
  microphone = gr.Audio(
261
  source="microphone", # Choose between "microphone", "upload"
@@ -268,6 +293,19 @@ with demo:
268
  recorded_output = gr.Textbox(label="Recognized speech from recordings")
269
  recorded_html_info = gr.HTML(label="Info")
270
 
 
 
 
 
 
 
 
 
 
 
 
 
 
271
  upload_button.click(
272
  process_uploaded_file,
273
  inputs=[
@@ -291,26 +329,6 @@ with demo:
291
  ],
292
  outputs=[recorded_output, recorded_html_info],
293
  )
294
- gr.Examples(
295
- examples=[
296
- [
297
- "./test_wavs/wenetspeech/DEV_T0000000000.opus",
298
- "Chinese",
299
- "luomingshuang/icefall_asr_wenetspeech_pruned_transducer_stateless2",
300
- "greedy_search",
301
- 4,
302
- ],
303
- ],
304
- inputs=[
305
- uploaded_file,
306
- language_radio,
307
- model_dropdown,
308
- decoding_method_radio,
309
- num_active_paths_slider,
310
- ],
311
- outputs=[uploaded_output, uploaded_html_info],
312
- fn=process_uploaded_file,
313
- )
314
  gr.Markdown(description)
315
 
316
  if __name__ == "__main__":
 
210
 
211
  demo = gr.Blocks(css=css)
212
 
213
+ examples = (
214
+ [
215
+ [
216
+ "./test_wavs/wenetspeech/DEV_T0000000000.opus",
217
+ "Chinese",
218
+ "luomingshuang/icefall_asr_wenetspeech_pruned_transducer_stateless2",
219
+ "greedy_search",
220
+ 4,
221
+ ],
222
+ ],
223
+ )
224
+
225
  with demo:
226
  gr.Markdown(title)
227
  language_choices = list(language_to_models.keys())
 
268
  uploaded_output = gr.Textbox(label="Recognized speech from uploaded file")
269
  uploaded_html_info = gr.HTML(label="Info")
270
 
271
+ gr.Examples(
272
+ examples=examples,
273
+ inputs=[
274
+ uploaded_file,
275
+ language_radio,
276
+ model_dropdown,
277
+ decoding_method_radio,
278
+ num_active_paths_slider,
279
+ ],
280
+ outputs=[uploaded_output, uploaded_html_info],
281
+ fn=process_uploaded_file,
282
+ )
283
+
284
  with gr.TabItem("Record from microphone"):
285
  microphone = gr.Audio(
286
  source="microphone", # Choose between "microphone", "upload"
 
293
  recorded_output = gr.Textbox(label="Recognized speech from recordings")
294
  recorded_html_info = gr.HTML(label="Info")
295
 
296
+ gr.Examples(
297
+ examples=examples,
298
+ inputs=[
299
+ microphone,
300
+ language_radio,
301
+ model_dropdown,
302
+ decoding_method_radio,
303
+ num_active_paths_slider,
304
+ ],
305
+ outputs=[recorded_output, recorded_html_info],
306
+ fn=process_microphone,
307
+ )
308
+
309
  upload_button.click(
310
  process_uploaded_file,
311
  inputs=[
 
329
  ],
330
  outputs=[recorded_output, recorded_html_info],
331
  )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
332
  gr.Markdown(description)
333
 
334
  if __name__ == "__main__":