Spaces:
Running
Running
Update app.py
Browse files
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="
|
27 |
-
description="**
|
28 |
-
article="**
|
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 |
),
|