cstr commited on
Commit
00124b5
·
verified ·
1 Parent(s): ecc4d6e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -8
app.py CHANGED
@@ -701,10 +701,9 @@ with gr.Blocks() as iface:
701
  gr.Markdown("Transcribe audio using multiple pipelines and (Faster) Whisper models.")
702
 
703
  with gr.Row():
704
- audio_upload = gr.Audio(label="Upload Audio")
705
- audio_record = gr.Audio(label="Record Audio", source="microphone")
706
  audio_url = gr.Textbox(label="Or Enter URL of audio file or YouTube link")
707
-
708
  transcribe_button = gr.Button("Transcribe")
709
 
710
  with gr.Accordion("Advanced Options", open=False):
@@ -771,15 +770,13 @@ with gr.Blocks() as iface:
771
  pipeline_type.change(update_model_dropdown, inputs=[pipeline_type], outputs=[model_id])
772
 
773
  def transcribe_with_progress(*args):
774
- # Combine audio_upload and audio_record into a single input
775
- audio_input = args[0] if args[0] is not None else args[1]
776
- modified_args = (audio_input,) + args[2:]
777
- for result in transcribe_audio(*modified_args):
778
  yield result
779
 
780
  transcribe_button.click(
781
  transcribe_with_progress,
782
- inputs=[audio_upload, audio_record, audio_url, proxy_url, proxy_username, proxy_password, pipeline_type, model_id, dtype, batch_size, download_method, start_time, end_time, verbose, include_timecodes],
783
  outputs=[metrics_output, transcription_output, transcription_file]
784
  )
785
 
 
701
  gr.Markdown("Transcribe audio using multiple pipelines and (Faster) Whisper models.")
702
 
703
  with gr.Row():
704
+ audio_input = gr.Audio(label="Upload or Record Audio", sources=["upload", "microphone"], type="filepath")
 
705
  audio_url = gr.Textbox(label="Or Enter URL of audio file or YouTube link")
706
+
707
  transcribe_button = gr.Button("Transcribe")
708
 
709
  with gr.Accordion("Advanced Options", open=False):
 
770
  pipeline_type.change(update_model_dropdown, inputs=[pipeline_type], outputs=[model_id])
771
 
772
  def transcribe_with_progress(*args):
773
+ # The audio_input is now the first argument
774
+ for result in transcribe_audio(*args):
 
 
775
  yield result
776
 
777
  transcribe_button.click(
778
  transcribe_with_progress,
779
+ inputs=[audio_input, audio_url, proxy_url, proxy_username, proxy_password, pipeline_type, model_id, dtype, batch_size, download_method, start_time, end_time, verbose, include_timecodes],
780
  outputs=[metrics_output, transcription_output, transcription_file]
781
  )
782