csukuangfj commited on
Commit
407c586
1 Parent(s): 9681d61

add cantonese

Browse files
Files changed (1) hide show
  1. model.py +7 -4
model.py CHANGED
@@ -203,9 +203,7 @@ def _get_vits_zh_aishell3(repo_id: str, speed: float) -> sherpa_onnx.OfflineTts:
203
 
204
  @lru_cache(maxsize=10)
205
  def _get_vits_hf(repo_id: str, speed: float) -> sherpa_onnx.OfflineTts:
206
- assert "csukuangfj/vits-zh-hf" in repo_id, repo_id
207
-
208
- if "fanchen" in repo_id:
209
  model = repo_id.split("/")[-1]
210
  else:
211
  model = repo_id.split("-")[-1]
@@ -269,6 +267,10 @@ def get_pretrained_model(repo_id: str, speed: float) -> sherpa_onnx.OfflineTts:
269
  raise ValueError(f"Unsupported repo_id: {repo_id}")
270
 
271
 
 
 
 
 
272
  chinese_models = {
273
  "csukuangfj/vits-zh-hf-theresa": _get_vits_hf,
274
  "csukuangfj/vits-zh-hf-eula": _get_vits_hf,
@@ -348,7 +350,8 @@ french_models = {
348
 
349
  language_to_models = {
350
  "English": list(english_models.keys()),
351
- "Chinese": list(chinese_models.keys()),
 
352
  "German": list(german_models.keys()),
353
  "Spanish": list(spanish_models.keys()),
354
  "French": list(french_models.keys()),
 
203
 
204
  @lru_cache(maxsize=10)
205
  def _get_vits_hf(repo_id: str, speed: float) -> sherpa_onnx.OfflineTts:
206
+ if "fanchen" in repo_id or "vits-cantonese-hf-xiaomaiiwn" in repo_id:
 
 
207
  model = repo_id.split("/")[-1]
208
  else:
209
  model = repo_id.split("-")[-1]
 
267
  raise ValueError(f"Unsupported repo_id: {repo_id}")
268
 
269
 
270
+ chinese_models = {
271
+ "csukuangfj/vits-cantonese-hf-xiaomaiiwn": _get_vits_hf,
272
+ }
273
+
274
  chinese_models = {
275
  "csukuangfj/vits-zh-hf-theresa": _get_vits_hf,
276
  "csukuangfj/vits-zh-hf-eula": _get_vits_hf,
 
350
 
351
  language_to_models = {
352
  "English": list(english_models.keys()),
353
+ "Chinese (Mandarin, 普通话)": list(chinese_models.keys()),
354
+ "Cantonese (粤语)": list(cantonese_models.keys()),
355
  "German": list(german_models.keys()),
356
  "Spanish": list(spanish_models.keys()),
357
  "French": list(french_models.keys()),