hugoiabd commited on
Commit
a1c7d96
1 Parent(s): c256705

Añadido modelo voluntaria

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -4,7 +4,7 @@ from transformers import pipeline
4
  import numpy as np
5
  import time
6
 
7
- pipe_base = pipeline("automatic-speech-recognition", model="aitor-medrano/lara-base-pushed")
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
- inicio_base = time.time()
20
- result_base = "base:" + pipe_base({"sampling_rate": sr, "raw": y})["text"]
21
- fin_base = 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 = "base_2000:" + pipe_hombres({"sampling_rate": sr, "raw": y})["text"]
29
  fin_hombres = time.time()
30
 
31
  fin = time.time()
32
 
33
- return result_base, fin_base - inicio_base, 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,8 +38,8 @@ demo = gr.Interface(fn=greet,
38
  gr.Audio(),
39
  ],
40
  outputs=[
41
- gr.Text(label="Salida (Base)"),
42
- gr.Number(label="Tiempo (Base)"),
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)"),