adicional4 / app.py
manapole's picture
Update app.py
1e73077 verified
raw
history blame contribute delete
688 Bytes
import gradio as gr
from transformers import pipeline
# Cargar pipeline de transcripci贸n con Whisper base
asr_pipe = pipeline("automatic-speech-recognition", model="openai/whisper-base", device=-1)
def transcribe(audio):
result = asr_pipe(audio)
return result['text']
demo = gr.Interface(
fn=transcribe,
inputs=gr.Audio(source="upload", type="filepath", label="Audio en ingl茅s"),
outputs=gr.Textbox(label="Transcripci贸n en ingl茅s"),
title="Transcripci贸n autom谩tica de voz a texto (Whisper)",
description="Sube un archivo de audio en ingl茅s (.wav, .mp3, etc.) y obt茅n la transcripci贸n usando Whisper."
)
if __name__ == "__main__":
demo.launch()