Spaces:
Running
Running
Update app.py
Browse files
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 |
-
|
343 |
-
|
|
|
344 |
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
|
|
|
|
|
|
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):
|