Spaces:
Runtime error
Runtime error
GuillermoPuma
commited on
Commit
路
2e212e5
1
Parent(s):
f9ec943
Agregando dependencias3 de pip para funcione en hugginface
Browse files- app.py +7 -4
- packages.txt +1 -6
app.py
CHANGED
@@ -5,10 +5,11 @@ from huggingsound import SpeechRecognitionModel
|
|
5 |
from models.model import *
|
6 |
from models.plantillas_codigo import *
|
7 |
from models.variables_globales import *
|
8 |
-
|
9 |
|
10 |
# creaci贸n del modelo
|
11 |
-
model = SpeechRecognitionModel("patrickvonplaten/wav2vec2-large-xlsr-53-spanish-with-lm")
|
|
|
12 |
|
13 |
|
14 |
|
@@ -132,9 +133,11 @@ def transcribe(audio, Espa帽ol, Codigo_Python):
|
|
132 |
global codigo
|
133 |
global indentacion
|
134 |
|
135 |
-
transcriptions_es = model.transcribe([audio])[0]
|
|
|
|
|
136 |
# quitamos el acento de la transcripcion
|
137 |
-
frase = unidecode.unidecode(transcriptions_es
|
138 |
|
139 |
# print(frase)
|
140 |
if not bloque:
|
|
|
5 |
from models.model import *
|
6 |
from models.plantillas_codigo import *
|
7 |
from models.variables_globales import *
|
8 |
+
from transformers import pipeline
|
9 |
|
10 |
# creaci贸n del modelo
|
11 |
+
# model = SpeechRecognitionModel("patrickvonplaten/wav2vec2-large-xlsr-53-spanish-with-lm")
|
12 |
+
p = pipeline("automatic-speech-recognition", model="patrickvonplaten/wav2vec2-large-xlsr-53-spanish-with-lm")
|
13 |
|
14 |
|
15 |
|
|
|
133 |
global codigo
|
134 |
global indentacion
|
135 |
|
136 |
+
#transcriptions_es = model.transcribe([audio])[0]
|
137 |
+
transcriptions_es = p([audio])['text']
|
138 |
+
|
139 |
# quitamos el acento de la transcripcion
|
140 |
+
frase = unidecode.unidecode(transcriptions_es).lower()
|
141 |
|
142 |
# print(frase)
|
143 |
if not bloque:
|
packages.txt
CHANGED
@@ -1,7 +1,2 @@
|
|
1 |
-
libsndfile1
|
2 |
-
python3.7-venv
|
3 |
-
freeglut3-dev
|
4 |
-
libgtk2.0-dev
|
5 |
-
libasound2-dev
|
6 |
-
libsndfile1-dev
|
7 |
ffmpeg
|
|
|
1 |
+
libsndfile1
|
|
|
|
|
|
|
|
|
|
|
2 |
ffmpeg
|