ZinebSN commited on
Commit
d8b5503
·
1 Parent(s): 16e53bc

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -0
app.py ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from transformers import pipeline
2
+ import gradio as gr
3
+
4
+ pipe = pipeline(model="ZinebSN/whisper-small") # change to "your-username/the-name-you-picked"
5
+
6
+ def transcribe(audio):
7
+ text = pipe(audio)["text"]
8
+ return text
9
+
10
+ iface = gr.Interface(
11
+ fn=transcribe,
12
+ inputs=[gr.Audio(source="microphone", type="filepath"),
13
+ gr.Text(label="URL (YouTube, etc.)"),
14
+ gr.Audio(source="upload", type="filepath", label="Upload Audio")]
15
+
16
+ outputs=[gr.File(label="Download"),
17
+ gr.Text(label="Text"),
18
+ gr.Text(label="Segments")],
19
+ title="Whisper Small Swedish",
20
+ description="Realtime demo for Swedish speech recognition using a fine-tuned Whisper small model.",
21
+ )
22
+
23
+ iface.launch()