Victorlopo21 commited on
Commit
6b51488
1 Parent(s): 5bb77aa

Update whisper_audio_file.py

Browse files
Files changed (1) hide show
  1. whisper_audio_file.py +3 -5
whisper_audio_file.py CHANGED
@@ -12,8 +12,6 @@ Upload audio file version.
12
  Installing requirements.
13
  """
14
 
15
- !pip install gradio
16
- !pip install git+https://github.com/huggingface/transformers
17
 
18
  from transformers import pipeline
19
  import gradio as gr
@@ -25,15 +23,15 @@ pipe = pipeline(model="Victorlopo21/whisper-medium-gl-30")
25
  #pipe = pipeline(model="marvmk/whisper-small-gl") # change to "your-username/the-name-you-picked"
26
 
27
  def transcribe(audio):
28
- text = pipe(audio, chunk_length=10)['text']
29
  return text
30
 
31
  iface = gr.Interface(
32
  fn=transcribe,
33
  inputs=gr.Audio(type="filepath"),
34
  outputs="text",
35
- title="Whisper Small Galician",
36
- description="Realtime demo for Galician speech recognition using a fine-tuned Whisper small model.",
37
  )
38
 
39
  iface.launch(debug=True)
 
12
  Installing requirements.
13
  """
14
 
 
 
15
 
16
  from transformers import pipeline
17
  import gradio as gr
 
23
  #pipe = pipeline(model="marvmk/whisper-small-gl") # change to "your-username/the-name-you-picked"
24
 
25
  def transcribe(audio):
26
+ text = pipe(audio)['text']
27
  return text
28
 
29
  iface = gr.Interface(
30
  fn=transcribe,
31
  inputs=gr.Audio(type="filepath"),
32
  outputs="text",
33
+ title="Whisper File Audio Medium Galician",
34
+ description="Realtime demo for Galician speech recognition with an audio file using a fine-tuned Whisper small model.",
35
  )
36
 
37
  iface.launch(debug=True)