asr_arabic / app.py
elina12's picture
Update app.py
492b047
raw
history blame
No virus
582 Bytes
# import gradio as gr
# model_interface = gr.Interface.load("models/jonatasgrosman/wav2vec2-large-xlsr-53-arabic", wait=True)
# model_interface.launch()
# Use a pipeline as a high-level helper
from transformers import pipeline
import gradio as gr
pipe = pipeline(model="jonatasgrosman/wav2vec2-large-xlsr-53-arabic") # change to "your-username/the-name-you-picked"
def transcribe(audio):
text = pipe(audio)["text"]
return text
iface = gr.Interface(
fn=transcribe,
inputs=gr.Audio(source="upload", type="filepath"),
outputs="text",
)
iface.launch()