Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,3 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
-
gr.Interface
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# import gradio as gr
|
2 |
+
|
3 |
+
# gr.Interface.load("models/tarteel-ai/whisper-base-ar-quran").launch()
|
4 |
+
from transformers import pipeline
|
5 |
+
|
6 |
+
model_id = "tarteel-ai/whisper-base-ar-quran"
|
7 |
+
pipe = pipeline("automatic-speech-recognition", model=model_id)
|
8 |
+
|
9 |
+
def transcribe(filepath):
|
10 |
+
output = pipe(
|
11 |
+
filepath
|
12 |
+
)
|
13 |
+
return output["text"]
|
14 |
+
|
15 |
import gradio as gr
|
16 |
|
17 |
+
iface = gr.Interface(
|
18 |
+
fn=transcribe,
|
19 |
+
inputs=gr.Audio(source="upload", type="filepath"),
|
20 |
+
outputs="text",
|
21 |
+
)
|
22 |
+
|
23 |
+
iface.launch()
|