matheuscervantes55's picture
Create app.py
a64afbd verified
raw
history blame contribute delete
541 Bytes
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)