eolang commited on
Commit
37dd873
·
verified ·
1 Parent(s): 948fbdb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -1,8 +1,10 @@
1
  import gradio as gr
 
2
 
3
- whisper = gr.load("eolang/whisper-small-sw")
4
 
5
  def transcribe(audio):
6
- return whisper(audio)
 
7
 
8
  gr.Interface(transcribe, gr.Audio(type="filepath"), gr.Textbox()).launch()
 
1
  import gradio as gr
2
+ from transformers import pipeline
3
 
4
+ pipe = pipeline("automatic-speech-recognition", model="eolang/whisper-small-sw")
5
 
6
  def transcribe(audio):
7
+ transcription = pipe(audio)
8
+ return transcription['text']
9
 
10
  gr.Interface(transcribe, gr.Audio(type="filepath"), gr.Textbox()).launch()