avfranco commited on
Commit
b040059
1 Parent(s): 908a6e1

Update app.py

Browse files

added gr.Audio

Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -37,7 +37,7 @@ def audio_transcribe(inputs):
37
  if inputs is None:
38
  raise gr.Error("No audio file submitted! Please upload or record an audio file before submitting your request.")
39
 
40
- text = pipe(inputs, batch_size=BATCH_SIZE, return_timestamps=True)["text"]
41
 
42
  return [text, gr.Textbox(visible=True),gr.Textbox(visible=True),gr.Textbox(visible=True)]
43
 
@@ -52,7 +52,7 @@ with gr.Blocks() as transcriberUI:
52
  Ambiente disponivel 24x7. Running on ZeroGPU with openai/whisper-large-v3
53
  """
54
  )
55
- inp = gr.File(label="Arquivo de Audio", show_label=True, type="filepath", file_count="single", file_types=["mp3","m4a"])
56
  transcribe = gr.Textbox(label="Transcricao", show_label=True, show_copy_button=True)
57
  ask_question = gr.Textbox(label="Ask a question", visible=False)
58
  response_output = gr.Textbox(label="Response", visible=False)
 
37
  if inputs is None:
38
  raise gr.Error("No audio file submitted! Please upload or record an audio file before submitting your request.")
39
 
40
+ text = pipe(inputs, batch_size=BATCH_SIZE, generate_kwargs={"task": "transcribe"}, return_timestamps=True)['text']
41
 
42
  return [text, gr.Textbox(visible=True),gr.Textbox(visible=True),gr.Textbox(visible=True)]
43
 
 
52
  Ambiente disponivel 24x7. Running on ZeroGPU with openai/whisper-large-v3
53
  """
54
  )
55
+ inp = gr.Audio(sources="upload", type="filepath", label="Audio file", format=["mp3","m4a"])
56
  transcribe = gr.Textbox(label="Transcricao", show_label=True, show_copy_button=True)
57
  ask_question = gr.Textbox(label="Ask a question", visible=False)
58
  response_output = gr.Textbox(label="Response", visible=False)