Spaces:
Sleeping
Sleeping
File size: 749 Bytes
bd2db3e eda3ea4 bd2db3e eda3ea4 bd2db3e eda3ea4 bd2db3e eda3ea4 bd2db3e 18e6694 bd2db3e 5d4734a 54d94fc 6ea09f0 bd2db3e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
import gradio as gr
from transformers import pipeline
import whisper
model_whisper = whisper.load_model("base")
nlp_model = pipeline("summarization", model="t5-base")
def process_audio(audio_file):
transcription = model_whisper.transcribe(audio_file)["text"]
summary = nlp_model(transcription)[0]["summary_text"]
return transcription, summary
# Aqui estuvo Fer
interface = gr.Interface(
fn=process_audio,
inputs=gr.Audio(type="filepath"),
outputs=[gr.Textbox(label="Transcripción"), gr.Textbox(label="Resumen")],
title="Transcripción y Análisis de Audio - PNL",
description="Sube un archivo de audio para transcribirlo y resumir el contenido o activa tu microfono y habla."
)
interface.launch() |