Spaces:
Sleeping
Sleeping
actualización con 4to modelo medium
Browse files
app.py
CHANGED
@@ -7,7 +7,8 @@ import time
|
|
7 |
# Utilizamos los tres modelos entrenados
|
8 |
pipe_model_1 = pipeline("automatic-speech-recognition", model="IABDs8a/AfinandoElEntrenamiento")
|
9 |
pipe_model_2 = pipeline("automatic-speech-recognition", model="IABDs8a/whisper-base-full")
|
10 |
-
pipe_model_3 = pipeline("automatic-speech-recognition", model="IABDs8a/whisper-
|
|
|
11 |
|
12 |
def transcribe(audio, model_choice):
|
13 |
inicio = time.time()
|
@@ -16,8 +17,10 @@ def transcribe(audio, model_choice):
|
|
16 |
pipe = pipe_model_1
|
17 |
elif model_choice == "Whisper Base Full":
|
18 |
pipe = pipe_model_2
|
19 |
-
|
20 |
pipe = pipe_model_3
|
|
|
|
|
21 |
|
22 |
# Leer el archivo de audio
|
23 |
y, sr = librosa.load(audio, sr=16000)
|
@@ -43,7 +46,7 @@ demo = gr.Interface(
|
|
43 |
fn=transcribe,
|
44 |
inputs=[
|
45 |
gr.Audio(type="filepath", label="Sube un archivo de audio o graba desde el micrófono"),
|
46 |
-
gr.Dropdown(choices=["AfinandoElEntrenamiento", "Whisper Base Full", "Whisper Tiny Top 3"], label="Selecciona el modelo", value="Whisper Base Full")
|
47 |
],
|
48 |
outputs=[
|
49 |
gr.Text(label="Salida"),
|
|
|
7 |
# Utilizamos los tres modelos entrenados
|
8 |
pipe_model_1 = pipeline("automatic-speech-recognition", model="IABDs8a/AfinandoElEntrenamiento")
|
9 |
pipe_model_2 = pipeline("automatic-speech-recognition", model="IABDs8a/whisper-base-full")
|
10 |
+
pipe_model_3 = pipeline("automatic-speech-recognition", model="IABDs8a/whisper-medium-asfe")
|
11 |
+
pipe_model_4 = pipeline("automatic-speech-recognition", model="IABDs8a/whisper-tiny-top3")
|
12 |
|
13 |
def transcribe(audio, model_choice):
|
14 |
inicio = time.time()
|
|
|
17 |
pipe = pipe_model_1
|
18 |
elif model_choice == "Whisper Base Full":
|
19 |
pipe = pipe_model_2
|
20 |
+
elif model_choice == "Whisper Medium Asfe":
|
21 |
pipe = pipe_model_3
|
22 |
+
else:
|
23 |
+
pipe = pipe_model_4
|
24 |
|
25 |
# Leer el archivo de audio
|
26 |
y, sr = librosa.load(audio, sr=16000)
|
|
|
46 |
fn=transcribe,
|
47 |
inputs=[
|
48 |
gr.Audio(type="filepath", label="Sube un archivo de audio o graba desde el micrófono"),
|
49 |
+
gr.Dropdown(choices=["AfinandoElEntrenamiento", "Whisper Base Full","Whisper Medium Asfe","Whisper Tiny Top 3"], label="Selecciona el modelo", value="Whisper Base Full")
|
50 |
],
|
51 |
outputs=[
|
52 |
gr.Text(label="Salida"),
|