Spaces:
Runtime error
Runtime error
Añadido modelo voluntaria
Browse files
app.py
CHANGED
@@ -4,7 +4,7 @@ from transformers import pipeline
|
|
4 |
import numpy as np
|
5 |
import time
|
6 |
|
7 |
-
|
8 |
pipe_small = pipeline("automatic-speech-recognition", model="aitor-medrano/whisper-small-lara")
|
9 |
pipe_hombres = pipeline("automatic-speech-recognition", model="IABDs8a/lara-hombres-equipo-3")
|
10 |
|
@@ -16,21 +16,21 @@ def greet(grabacion):
|
|
16 |
y = y.astype(np.float32)
|
17 |
y /= np.max(np.abs(y))
|
18 |
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
|
23 |
inicio_small = time.time()
|
24 |
result_small = "small:" + pipe_small({"sampling_rate": sr, "raw": y})["text"]
|
25 |
fin_small = time.time()
|
26 |
|
27 |
inicio_hombres = time.time()
|
28 |
-
result_hombres = "
|
29 |
fin_hombres = time.time()
|
30 |
|
31 |
fin = time.time()
|
32 |
|
33 |
-
return
|
34 |
#return result_base, result_small, fin - inicio
|
35 |
|
36 |
demo = gr.Interface(fn=greet,
|
@@ -38,8 +38,8 @@ demo = gr.Interface(fn=greet,
|
|
38 |
gr.Audio(),
|
39 |
],
|
40 |
outputs=[
|
41 |
-
gr.Text(label="Salida (
|
42 |
-
gr.Number(label="Tiempo (
|
43 |
gr.Text(label="Salida (Small)"),
|
44 |
gr.Number(label="Tiempo (Small)"),
|
45 |
gr.Text(label="Salida (Hombres)"),
|
|
|
4 |
import numpy as np
|
5 |
import time
|
6 |
|
7 |
+
pipe_vol_g = pipeline("automatic-speech-recognition", model="hugoiabd/whisper-equipo3-g")
|
8 |
pipe_small = pipeline("automatic-speech-recognition", model="aitor-medrano/whisper-small-lara")
|
9 |
pipe_hombres = pipeline("automatic-speech-recognition", model="IABDs8a/lara-hombres-equipo-3")
|
10 |
|
|
|
16 |
y = y.astype(np.float32)
|
17 |
y /= np.max(np.abs(y))
|
18 |
|
19 |
+
inicio_g = time.time()
|
20 |
+
result_g = "g:" + pipe_vol_g({"sampling_rate": sr, "raw": y})["text"]
|
21 |
+
fin_g = time.time()
|
22 |
|
23 |
inicio_small = time.time()
|
24 |
result_small = "small:" + pipe_small({"sampling_rate": sr, "raw": y})["text"]
|
25 |
fin_small = time.time()
|
26 |
|
27 |
inicio_hombres = time.time()
|
28 |
+
result_hombres = "hombres:" + pipe_hombres({"sampling_rate": sr, "raw": y})["text"]
|
29 |
fin_hombres = time.time()
|
30 |
|
31 |
fin = time.time()
|
32 |
|
33 |
+
return result_g, fin_g - inicio_g, result_small, fin_small - inicio_small, result_hombres, fin_hombres - inicio_hombres, fin - inicio
|
34 |
#return result_base, result_small, fin - inicio
|
35 |
|
36 |
demo = gr.Interface(fn=greet,
|
|
|
38 |
gr.Audio(),
|
39 |
],
|
40 |
outputs=[
|
41 |
+
gr.Text(label="Salida (Voluntaria G)"),
|
42 |
+
gr.Number(label="Tiempo (Voluntaria G)"),
|
43 |
gr.Text(label="Salida (Small)"),
|
44 |
gr.Number(label="Tiempo (Small)"),
|
45 |
gr.Text(label="Salida (Hombres)"),
|