File size: 325 Bytes
c774331
 
24298fa
c774331
 
 
 
 
 
 
 
 
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()