Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -6,7 +6,7 @@ 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_base_2000 = pipeline("automatic-speech-recognition", model="aitor-medrano/whisper-base-lara-2000")
|
10 |
|
11 |
def greet(grabacion):
|
12 |
inicio = time.time()
|
@@ -18,11 +18,12 @@ def greet(grabacion):
|
|
18 |
|
19 |
result_base = "base:" + pipe_base({"sampling_rate": sr, "raw": y})["text"]
|
20 |
result_small = "small:" + pipe_small({"sampling_rate": sr, "raw": y})["text"]
|
21 |
-
result_base_2000 = "base_2000:" + pipe_base_2000({"sampling_rate": sr, "raw": y})["text"]
|
22 |
|
23 |
fin = time.time()
|
24 |
|
25 |
-
return result_base, result_small, result_base_2000, fin - inicio
|
|
|
26 |
|
27 |
demo = gr.Interface(fn=greet,
|
28 |
inputs=[
|
@@ -31,7 +32,7 @@ demo = gr.Interface(fn=greet,
|
|
31 |
outputs=[
|
32 |
gr.Text(label="Salida (Base)"),
|
33 |
gr.Text(label="Salida (Small)"),
|
34 |
-
gr.Text(label="Salida (Base 2000)"),
|
35 |
gr.Number(label="Tiempo")
|
36 |
])
|
37 |
demo.launch()
|
|
|
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_base_2000 = pipeline("automatic-speech-recognition", model="aitor-medrano/whisper-base-lara-2000")
|
10 |
|
11 |
def greet(grabacion):
|
12 |
inicio = time.time()
|
|
|
18 |
|
19 |
result_base = "base:" + pipe_base({"sampling_rate": sr, "raw": y})["text"]
|
20 |
result_small = "small:" + pipe_small({"sampling_rate": sr, "raw": y})["text"]
|
21 |
+
#result_base_2000 = "base_2000:" + pipe_base_2000({"sampling_rate": sr, "raw": y})["text"]
|
22 |
|
23 |
fin = time.time()
|
24 |
|
25 |
+
#return result_base, result_small, result_base_2000, fin - inicio
|
26 |
+
return result_base, result_small, fin - inicio
|
27 |
|
28 |
demo = gr.Interface(fn=greet,
|
29 |
inputs=[
|
|
|
32 |
outputs=[
|
33 |
gr.Text(label="Salida (Base)"),
|
34 |
gr.Text(label="Salida (Small)"),
|
35 |
+
#gr.Text(label="Salida (Base 2000)"),
|
36 |
gr.Number(label="Tiempo")
|
37 |
])
|
38 |
demo.launch()
|