File size: 366 Bytes
62af362
 
 
 
 
 
 
 
 
 
8b00f49
62af362
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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()