lucio commited on
Commit
d47cc89
1 Parent(s): 5915225
Files changed (1) hide show
  1. app.py +8 -10
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 model_path.startswith('http'):
71
- if not exists(file_name):
72
- print(f"Downloading {model_path}")
73
- r = requests.get(model_path, allow_redirects=True)
74
- with open(file_name, 'wb') as file:
75
- file.write(r.content)
76
- else:
77
- print(f"Found {file_name}. Skipping download...")
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)