avilaroman commited on
Commit
eb17f5b
1 Parent(s): e5583f6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -9
app.py CHANGED
@@ -5,8 +5,8 @@ import pytube as pt
5
  from transformers import pipeline
6
  from huggingface_hub import model_info
7
 
8
- MODEL_NAME = "openai/whisper-small" #this always needs to stay in line 8 :D sorry for the hackiness
9
- lang = "en"
10
 
11
  device = 0 if torch.cuda.is_available() else "cpu"
12
  pipe = pipeline(
@@ -22,12 +22,12 @@ def transcribe(microphone, file_upload):
22
  warn_output = ""
23
  if (microphone is not None) and (file_upload is not None):
24
  warn_output = (
25
- "WARNING: You've uploaded an audio file and used the microphone. "
26
- "The recorded file from the microphone will be used and the uploaded audio will be discarded.\n"
27
  )
28
 
29
  elif (microphone is None) and (file_upload is None):
30
- return "ERROR: You have to either use the microphone or upload an audio file"
31
 
32
  file = microphone if microphone is not None else file_upload
33
 
@@ -67,9 +67,9 @@ mf_transcribe = gr.Interface(
67
  outputs="text",
68
  layout="horizontal",
69
  theme="huggingface",
70
- title="Whisper Demo: Transcribe Audio",
71
  description=(
72
- "Transcribe long-form microphone or audio inputs with the click of a button! Demo uses the the fine-tuned"
73
  f" checkpoint [{MODEL_NAME}](https://huggingface.co/{MODEL_NAME}) and 🤗 Transformers to transcribe audio files"
74
  " of arbitrary length."
75
  ),
@@ -82,9 +82,9 @@ yt_transcribe = gr.Interface(
82
  outputs=["html", "text"],
83
  layout="horizontal",
84
  theme="huggingface",
85
- title="Whisper Demo: Transcribe YouTube",
86
  description=(
87
- "Transcribe long-form YouTube videos with the click of a button! Demo uses the the fine-tuned checkpoint:"
88
  f" [{MODEL_NAME}](https://huggingface.co/{MODEL_NAME}) and 🤗 Transformers to transcribe audio files of"
89
  " arbitrary length."
90
  ),
 
5
  from transformers import pipeline
6
  from huggingface_hub import model_info
7
 
8
+ MODEL_NAME = "openai/whisper-small" #Ésto es la base de con lo que trabaja el script entonces hay que cargarlo en la linea 8.
9
+ lang = "es"
10
 
11
  device = 0 if torch.cuda.is_available() else "cpu"
12
  pipe = pipeline(
 
22
  warn_output = ""
23
  if (microphone is not None) and (file_upload is not None):
24
  warn_output = (
25
+ "Consejo: Subiste un Archivo de Audio y usado el micrófono. "
26
+ "el Archivo Grabado del Microfono Local será enviado a Analizar. OK!\n"
27
  )
28
 
29
  elif (microphone is None) and (file_upload is None):
30
+ return "Advertencia: Tu tienes los 2 usa el Micrófono o un archivo subido desde tu PC."
31
 
32
  file = microphone if microphone is not None else file_upload
33
 
 
67
  outputs="text",
68
  layout="horizontal",
69
  theme="huggingface",
70
+ title="Escucha",
71
  description=(
72
+ "Transcribe Largas capturas de audio de Radio 160.310 Mgh por micrófono o grabaciones desde archivos a 1 click y gratis! Ésta version está utilizando por defecto fine-tuned para el mejor aprovechamiento del contexto."
73
  f" checkpoint [{MODEL_NAME}](https://huggingface.co/{MODEL_NAME}) and 🤗 Transformers to transcribe audio files"
74
  " of arbitrary length."
75
  ),
 
82
  outputs=["html", "text"],
83
  layout="horizontal",
84
  theme="huggingface",
85
+ title="Escucha: Transcribe los videos de YouTube",
86
  description=(
87
+ "Transcribe Largas capturas de audio de Radio 160.310 Mgh por micrófono o grabaciones desde archivos a 1 click y gratis! Ésta version está utilizando por defecto fine-tuned para el mejor aprovechamiento del contexto."
88
  f" [{MODEL_NAME}](https://huggingface.co/{MODEL_NAME}) and 🤗 Transformers to transcribe audio files of"
89
  " arbitrary length."
90
  ),