cstr commited on
Commit
4f55f4b
1 Parent(s): d990dd0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -7
app.py CHANGED
@@ -339,15 +339,20 @@ with gr.Blocks() as iface:
339
  transcription_file = gr.File(label="Download Transcription")
340
 
341
  def update_model_dropdown(pipeline_type):
342
- model_choices = get_model_options(pipeline_type)
343
- logging.info(f"Model choices for {pipeline_type}: {model_choices}")
 
344
 
345
- if model_choices:
346
- return gr.Dropdown.update(choices=model_choices, value=model_choices[0], visible=True)
347
- else:
348
- return gr.Dropdown.update(choices=["No models available"], value=None, visible=False)
 
 
 
349
 
350
- pipeline_type.change(update_model_dropdown, inputs=pipeline_type, outputs=model_id)
 
351
 
352
  def transcribe_with_progress(*args):
353
  for result in transcribe_audio(*args):
 
339
  transcription_file = gr.File(label="Download Transcription")
340
 
341
  def update_model_dropdown(pipeline_type):
342
+ try:
343
+ model_choices = get_model_options(pipeline_type)
344
+ logging.info(f"Model choices for {pipeline_type}: {model_choices}")
345
 
346
+ if model_choices:
347
+ return gr.update(choices=model_choices, value=model_choices[0], visible=True)
348
+ else:
349
+ return gr.update(choices=["No models available"], value=None, visible=False)
350
+ except Exception as e:
351
+ logging.error(f"Error in update_model_dropdown: {str(e)}")
352
+ return gr.update(choices=["Error"], value="Error", visible=True)
353
 
354
+ #pipeline_type.change(update_model_dropdown, inputs=pipeline_type, outputs=model_id)
355
+ pipeline_type.change(update_model_dropdown, inputs=[pipeline_type], outputs=model_id)
356
 
357
  def transcribe_with_progress(*args):
358
  for result in transcribe_audio(*args):