Audiototext / app.py
Hugomartinezg's picture
Create app.py
1e1197e verified
raw
history blame
473 Bytes
from transformers import pipeline
import gradio as gr
# Cargar el modelo de reconocimiento automático de voz
modelo = pipeline("automatic-speech-recognition", model="facebook/wav2vec2-large-xlsr-53-spanish")
def transcribe(audio):
# Transcribir el audio a texto usando el modelo
text = modelo(audio)["text"]
return text
# Crear la interfaz de Gradio
gr.Interface(
fn=transcribe,
inputs=gr.Audio(type="filepath"),
outputs=gr.Textbox()
).launch()