Spaces:
Runtime error
Runtime error
fix stuff
Browse files
app.py
CHANGED
@@ -47,7 +47,6 @@ def client(audio_data: np.array, sample_rate: int, default_lang: str):
|
|
47 |
audio = np.frombuffer(fin.readframes(fin.getnframes()), np.int16)
|
48 |
|
49 |
fin.close()
|
50 |
-
print(STT_MODELS)
|
51 |
print(default_lang, text_lab)
|
52 |
|
53 |
if text_lab == 'Spanish':
|
@@ -67,15 +66,14 @@ def load_coqui_models(language):
|
|
67 |
|
68 |
model_path, file_name = model_info.get("language", ("", ""))
|
69 |
|
70 |
-
if
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
return Model(file_name)
|
79 |
|
80 |
for lang in ('mixteco', 'chatino', 'totonaco'):
|
81 |
STT_MODELS[lang] = load_coqui_models(lang)
|
|
|
47 |
audio = np.frombuffer(fin.readframes(fin.getnframes()), np.int16)
|
48 |
|
49 |
fin.close()
|
|
|
50 |
print(default_lang, text_lab)
|
51 |
|
52 |
if text_lab == 'Spanish':
|
|
|
66 |
|
67 |
model_path, file_name = model_info.get("language", ("", ""))
|
68 |
|
69 |
+
if not exists(file_name):
|
70 |
+
print(f"Downloading {model_path}")
|
71 |
+
r = requests.get(model_path, allow_redirects=True)
|
72 |
+
with open(file_name, 'wb') as file:
|
73 |
+
file.write(r.content)
|
74 |
+
else:
|
75 |
+
print(f"Found {file_name}. Skipping download...")
|
76 |
+
return Model(file_name)
|
|
|
77 |
|
78 |
for lang in ('mixteco', 'chatino', 'totonaco'):
|
79 |
STT_MODELS[lang] = load_coqui_models(lang)
|