File size: 688 Bytes
3e6200a
1e73077
3e6200a
1e73077
 
3e6200a
1e73077
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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()