Abhinay0806 commited on
Commit
79795dc
·
verified ·
1 Parent(s): bc1d0d2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -6,7 +6,7 @@ transcriber = pipeline(model="openai/whisper-small", task="automatic-speech-reco
6
 
7
  # Define the transcription function
8
  def transcribe_audio(audio):
9
- # The audio input comes in as a tuple (sample_rate, audio_data)
10
  result = transcriber(audio, generate_kwargs={"language": "<|en|>"})
11
  return result['text']
12
 
@@ -15,7 +15,7 @@ with gr.Blocks() as demo:
15
  gr.Markdown("## Whisper Small - Audio Transcription (English)")
16
 
17
  # Create a file uploader and a text output
18
- audio_input = gr.Audio(source="upload", type="filepath", label="Upload Audio File")
19
  text_output = gr.Textbox(label="Transcribed Text")
20
 
21
  # Create a button to trigger transcription
 
6
 
7
  # Define the transcription function
8
  def transcribe_audio(audio):
9
+ # The audio input comes in as a file path
10
  result = transcriber(audio, generate_kwargs={"language": "<|en|>"})
11
  return result['text']
12
 
 
15
  gr.Markdown("## Whisper Small - Audio Transcription (English)")
16
 
17
  # Create a file uploader and a text output
18
+ audio_input = gr.Audio(type="filepath", label="Upload Audio File")
19
  text_output = gr.Textbox(label="Transcribed Text")
20
 
21
  # Create a button to trigger transcription