Spaces:
Sleeping
Sleeping
modificaciones necesarias
Browse files
app.py
CHANGED
@@ -2,24 +2,21 @@ import gradio as gr
|
|
2 |
from transformers import pipeline
|
3 |
import whisper
|
4 |
|
5 |
-
|
6 |
model_whisper = whisper.load_model("base")
|
7 |
|
8 |
-
|
9 |
-
# Ejemplo de T5 para tareas de generaci贸n de texto
|
10 |
nlp_model = pipeline("summarization", model="t5-base")
|
11 |
|
12 |
-
|
13 |
def process_audio(audio_file):
|
14 |
-
|
15 |
transcription = model_whisper.transcribe(audio_file)["text"]
|
16 |
|
17 |
-
# Realizar tareas de PLN sobre el texto transcrito
|
18 |
summary = nlp_model(transcription)[0]["summary_text"]
|
19 |
|
20 |
return transcription, summary
|
21 |
|
22 |
-
# Interfaz de usuario usando Gradio
|
23 |
interface = gr.Interface(
|
24 |
fn=process_audio,
|
25 |
inputs=gr.Audio(type="filepath"),
|
|
|
2 |
from transformers import pipeline
|
3 |
import whisper
|
4 |
|
5 |
+
|
6 |
model_whisper = whisper.load_model("base")
|
7 |
|
8 |
+
|
|
|
9 |
nlp_model = pipeline("summarization", model="t5-base")
|
10 |
|
11 |
+
|
12 |
def process_audio(audio_file):
|
13 |
+
|
14 |
transcription = model_whisper.transcribe(audio_file)["text"]
|
15 |
|
|
|
16 |
summary = nlp_model(transcription)[0]["summary_text"]
|
17 |
|
18 |
return transcription, summary
|
19 |
|
|
|
20 |
interface = gr.Interface(
|
21 |
fn=process_audio,
|
22 |
inputs=gr.Audio(type="filepath"),
|