asr_model / app.py
Abdelmoumene Boumadane
added the asr space
d347b85
raw
history blame
453 Bytes
import gradio as gr
from speechbrain.pretrained import EncoderASR
asr_model = EncoderASR.from_hparams(source="speechbrain/asr-wav2vec2-commonvoice-fr", savedir="pretrained_models/asr-wav2vec2-commonvoice-fr")
def speech_recognize(file):
text = asr_model.transcribe_file(file)
return text
iface = gr.Interface(
fn=speech_recognize,
inputs=gr.inputs.Audio(source="microphone", type='filepath'),
outputs="text",
)
iface.launch()