Miamoto commited on
Commit
220065d
·
1 Parent(s): a591a79

Add application file

Browse files
Files changed (1) hide show
  1. app.py +19 -0
app.py ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import pipeline
3
+
4
+ asr = pipeline("automatic-speech-recognition", model="inesc-id/WhisperLv3-FT")
5
+
6
+ def transcribe(audio):
7
+ text = asr(audio)["text"]
8
+ return text
9
+
10
+ demo = gr.Interface(
11
+ fn=transcribe,
12
+ inputs=gr.Audio(sources=["microphone", "upload"], type="filepath"),
13
+ outputs="text",
14
+ title="Speech Recognition Demo",
15
+ description="Speak or upload an audio file and get the transcription."
16
+ )
17
+
18
+ demo.launch()
19
+