baaabaei commited on
Commit
1acda07
·
verified ·
1 Parent(s): 9d5aa32

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -0
app.py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import pipeline
3
+
4
+ pipe = pipeline(model="baaabaei/whisper-fa") # change to "your-username/the-name-you-picked"
5
+ def transcribe(audio):
6
+ text = pipe(audio)["text"]
7
+ return text
8
+ iface = gr.Interface(
9
+ fn=transcribe,
10
+ inputs=gr.Audio(source="microphone", type="filepath"),
11
+ outputs="text",
12
+ title="Whisper Small Persian",
13
+ description="Realtime demo for persian speech recognition using a fine-tuned Whisper small model.",
14
+ )
15
+ iface.launch()"
16
+