Spaces:
Runtime error
Runtime error
update model
Browse files
app.py
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from transformers import pipeline
|
2 |
+
import gradio as gr
|
3 |
+
|
4 |
+
model = pipeline(model="gymeee/demo_code_switching")
|
5 |
+
|
6 |
+
|
7 |
+
def transcribe_audio(mic):
|
8 |
+
|
9 |
+
audio = mic
|
10 |
+
transcription = model(audio)["text"]
|
11 |
+
return transcription
|
12 |
+
|
13 |
+
|
14 |
+
gr.Interface(
|
15 |
+
fn=transcribe_audio,
|
16 |
+
inputs=[
|
17 |
+
gr.Audio(source="microphone", type="filepath", optional=True),
|
18 |
+
|
19 |
+
],
|
20 |
+
outputs="text",
|
21 |
+
share=True
|
22 |
+
).launch(share=True)
|