File size: 541 Bytes
a64afbd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import gradio as gr
from transformers import pipeline

pipe = pipeline(
    "automatic-speech-recognition", 
    model="jonatasgrosman/wav2vec2-large-xlsr-53-portuguese" 
)

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

iface = gr.Interface(
    fn=transcribe,
    inputs=gr.Audio(sources=["upload"], type="filepath", label="Carregue o áudio"), 
    outputs="text",
    title="Aplicativo de Reconhecimento de Fala",
    description="Carregue um arquivo de áudio para transcrever sua fala.",
)

iface.launch(share=True)