import gradio as gr | |
from transformers import pipeline | |
p = pipeline("automatic-speech-recognition", model="techiaith/wav2vec2-xlsr-ft-cy", decoder = "Wav2Vec2ProcessorWithLM") | |
def transcribe(audio): | |
text = p(audio)["text"] | |
return text | |
demo = gr.Interface( | |
transcribe, | |
gr.Audio(sources=["microphone"], type="filepath"), | |
"text", | |
) | |
demo.launch() | |