cstr commited on
Commit
ed10fe0
1 Parent(s): d811f00

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -10
app.py CHANGED
@@ -290,16 +290,6 @@ def transcribe_audio(input_source, pipeline_type, model_id, dtype, batch_size, d
290
  except:
291
  pass
292
 
293
- def update_model_dropdown(pipeline_type):
294
- model_choices = get_model_options(pipeline_type)
295
- logging.info(f"Model choices for {pipeline_type}: {model_choices}")
296
-
297
- # Check if there are model choices available before setting the value
298
- if model_choices:
299
- return gr.Dropdown.update(choices=model_choices, value=model_choices[0])
300
- else:
301
- return gr.Dropdown.update(choices=[], value=None)
302
-
303
  with gr.Blocks() as iface:
304
  gr.Markdown("# Multi-Pipeline Transcription")
305
  gr.Markdown("Transcribe audio using multiple pipelines and models.")
@@ -338,6 +328,15 @@ with gr.Blocks() as iface:
338
  transcription_output = gr.Textbox(label="Transcription", lines=10)
339
  transcription_file = gr.File(label="Download Transcription")
340
 
 
 
 
 
 
 
 
 
 
341
  pipeline_type.change(update_model_dropdown, inputs=pipeline_type, outputs=model_id)
342
 
343
  transcribe_button.click(
 
290
  except:
291
  pass
292
 
 
 
 
 
 
 
 
 
 
 
293
  with gr.Blocks() as iface:
294
  gr.Markdown("# Multi-Pipeline Transcription")
295
  gr.Markdown("Transcribe audio using multiple pipelines and models.")
 
328
  transcription_output = gr.Textbox(label="Transcription", lines=10)
329
  transcription_file = gr.File(label="Download Transcription")
330
 
331
+ def update_model_dropdown(pipeline_type):
332
+ model_choices = get_model_options(pipeline_type)
333
+ logging.info(f"Model choices for {pipeline_type}: {model_choices}")
334
+
335
+ if model_choices:
336
+ return gr.Dropdown.update(choices=model_choices, value=model_choices[0], visible=True)
337
+ else:
338
+ return gr.Dropdown.update(choices=["No models available"], value=None, visible=False)
339
+
340
  pipeline_type.change(update_model_dropdown, inputs=pipeline_type, outputs=model_id)
341
 
342
  transcribe_button.click(