MarcoM003 commited on
Commit
fd98940
1 Parent(s): ec9627a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -17
app.py CHANGED
@@ -5,15 +5,7 @@ import whisper
5
  def whisper_transcript(model_size, audio_file):
6
 
7
  source = audio_file
8
-
9
- if model_size.endswith(".en"):
10
- language = "english"
11
-
12
- else:
13
- language = None
14
-
15
- options = whisper.DecodingOptions(without_timestamps=True)
16
-
17
  loaded_model = whisper.load_model(model_size)
18
  transcript = loaded_model.transcribe(source, language=language)
19
 
@@ -23,9 +15,9 @@ def whisper_transcript(model_size, audio_file):
23
  gradio_ui = gr.Interface(
24
  fn=whisper_transcript,
25
  theme="Nymbo/Nymbo_Theme",
26
- title="Transcribe multi-lingual audio clips with Whisper",
27
- description="**How to use**: Select a model, paste in a Youtube link or upload an audio clip, then click submit. If your clip is **100% in English, select models ending in ‘.en’**. If the clip is in other languages, or a mix of languages, select models without ‘.en’",
28
- article="**Note**: The larger the model size selected or the longer the audio clip, the more time it would take to process the transcript.",
29
  inputs=[
30
  gr.Dropdown(
31
  label="Select Model",
@@ -34,11 +26,6 @@ gradio_ui = gr.Interface(
34
  "base.en",
35
  "small.en",
36
  "medium.en",
37
- "tiny",
38
- "base",
39
- "small",
40
- "medium",
41
- "large",
42
  ],
43
  value="base",
44
  ),
 
5
  def whisper_transcript(model_size, audio_file):
6
 
7
  source = audio_file
8
+ language = "english"
 
 
 
 
 
 
 
 
9
  loaded_model = whisper.load_model(model_size)
10
  transcript = loaded_model.transcribe(source, language=language)
11
 
 
15
  gradio_ui = gr.Interface(
16
  fn=whisper_transcript,
17
  theme="Nymbo/Nymbo_Theme",
18
+ title="Transcribir audios en inglés a texto",
19
+ description="**Cómo usar**: Elegir uno de los modelos, subir un audio y clicar el botón de Submit.",
20
+ article="**Nota**: Exclusivo para audios en inglés.",
21
  inputs=[
22
  gr.Dropdown(
23
  label="Select Model",
 
26
  "base.en",
27
  "small.en",
28
  "medium.en",
 
 
 
 
 
29
  ],
30
  value="base",
31
  ),