Update app.py
Browse files
app.py
CHANGED
@@ -1,8 +1,10 @@
|
|
1 |
import gradio as gr
|
|
|
2 |
|
3 |
-
|
4 |
|
5 |
def transcribe(audio):
|
6 |
-
|
|
|
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()
|