UnionJack commited on
Commit
eda3ea4
verified
1 Parent(s): 3dac65a

modificaciones necesarias

Browse files
Files changed (1) hide show
  1. app.py +4 -7
app.py CHANGED
@@ -2,24 +2,21 @@ import gradio as gr
2
  from transformers import pipeline
3
  import whisper
4
 
5
- # Cargar el modelo de transcripci贸n Whisper
6
  model_whisper = whisper.load_model("base")
7
 
8
- # Cargar un modelo de lenguaje pre-entrenado para PLN (Hugging Face)
9
- # Ejemplo de T5 para tareas de generaci贸n de texto
10
  nlp_model = pipeline("summarization", model="t5-base")
11
 
12
- # Funci贸n para transcribir el audio y procesar el texto
13
  def process_audio(audio_file):
14
- # Transcribir el audio
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"),