File size: 325 Bytes
2ac91cb
 
aa6a233
1dbebc5
2ac91cb
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
import gradio as gr
from transformers import pipeline
p = pipeline("automatic-speech-recognition", model="facebook/wav2vec2-base-960h")

def transcribe(audio):
    text = p(audio)["text"]
    return text

gr.Interface(
    fn=transcribe,
    inputs=gr.Audio(source="microphone", type="filepath"),
    outputs="text").launch()