csukuangfj commited on
Commit
abeb4dc
1 Parent(s): 71c0d81

add melo tts

Browse files
Files changed (2) hide show
  1. model.py +10 -1
  2. requirements.txt +2 -2
model.py CHANGED
@@ -236,6 +236,8 @@ def _get_vits_hf(repo_id: str, speed: float) -> sherpa_onnx.OfflineTts:
236
 
237
  if "fanchen" in repo_id or "vits-cantonese-hf-xiaomaiiwn" in repo_id:
238
  model = repo_id.split("/")[-1]
 
 
239
  else:
240
  model = repo_id.split("-")[-1]
241
 
@@ -269,7 +271,7 @@ def _get_vits_hf(repo_id: str, speed: float) -> sherpa_onnx.OfflineTts:
269
  rule_fars = ""
270
 
271
  if "vits-cantonese-hf-xiaomaiiwn" not in repo_id:
272
- rule_fsts = ["phone.fst", "date.fst", "number.fst", "new_heteronym.fst"]
273
 
274
  rule_fsts = [
275
  get_file(
@@ -320,6 +322,8 @@ def _get_vits_hf(repo_id: str, speed: float) -> sherpa_onnx.OfflineTts:
320
  def get_pretrained_model(repo_id: str, speed: float) -> sherpa_onnx.OfflineTts:
321
  if repo_id in chinese_models:
322
  return chinese_models[repo_id](repo_id, speed)
 
 
323
  if repo_id in cantonese_models:
324
  return cantonese_models[repo_id](repo_id, speed)
325
  elif repo_id in english_models:
@@ -424,6 +428,10 @@ cantonese_models = {
424
  "csukuangfj/vits-cantonese-hf-xiaomaiiwn": _get_vits_hf,
425
  }
426
 
 
 
 
 
427
  chinese_models = {
428
  "csukuangfj/vits-zh-hf-fanchen-wnj|1": _get_vits_hf, # 1
429
  "csukuangfj/vits-zh-hf-fanchen-C|187": _get_vits_hf, # 187
@@ -766,6 +774,7 @@ welsh_models = {
766
  language_to_models = {
767
  "English": list(english_models.keys()),
768
  "Chinese (Mandarin, 普通话)": list(chinese_models.keys()),
 
769
  "Cantonese (粤语)": list(cantonese_models.keys()),
770
  "Min-nan (闽南话)": list(min_nan_models.keys()),
771
  "Arabic": list(arabic_models.keys()),
 
236
 
237
  if "fanchen" in repo_id or "vits-cantonese-hf-xiaomaiiwn" in repo_id:
238
  model = repo_id.split("/")[-1]
239
+ elif "csukuangfj/vits-melo-tts-zh_en" == repo_id:
240
+ model = "model"
241
  else:
242
  model = repo_id.split("-")[-1]
243
 
 
271
  rule_fars = ""
272
 
273
  if "vits-cantonese-hf-xiaomaiiwn" not in repo_id:
274
+ rule_fsts = ["phone.fst", "date.fst", "number.fst"]
275
 
276
  rule_fsts = [
277
  get_file(
 
322
  def get_pretrained_model(repo_id: str, speed: float) -> sherpa_onnx.OfflineTts:
323
  if repo_id in chinese_models:
324
  return chinese_models[repo_id](repo_id, speed)
325
+ elif repo_id in chinese_english_models:
326
+ return chinese_english_models[repo_id](repo_id, speed)
327
  if repo_id in cantonese_models:
328
  return cantonese_models[repo_id](repo_id, speed)
329
  elif repo_id in english_models:
 
428
  "csukuangfj/vits-cantonese-hf-xiaomaiiwn": _get_vits_hf,
429
  }
430
 
431
+ chinese_english_models = {
432
+ "csukuangfj/vits-melo-tts-zh_en|1": _get_vits_hf, # 1
433
+ }
434
+
435
  chinese_models = {
436
  "csukuangfj/vits-zh-hf-fanchen-wnj|1": _get_vits_hf, # 1
437
  "csukuangfj/vits-zh-hf-fanchen-C|187": _get_vits_hf, # 187
 
774
  language_to_models = {
775
  "English": list(english_models.keys()),
776
  "Chinese (Mandarin, 普通话)": list(chinese_models.keys()),
777
+ "Chinese+English": list(chinese_english_models.keys()),
778
  "Cantonese (粤语)": list(cantonese_models.keys()),
779
  "Min-nan (闽南话)": list(min_nan_models.keys()),
780
  "Arabic": list(arabic_models.keys()),
requirements.txt CHANGED
@@ -1,4 +1,4 @@
1
- https://huggingface.co/csukuangfj/sherpa-onnx-wheels/resolve/main/sherpa_onnx-1.9.23-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
2
- #sherpa-onnx
3
 
4
  soundfile
 
1
+ #https://huggingface.co/csukuangfj/sherpa-onnx-wheels/resolve/main/sherpa_onnx-1.9.23-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
2
+ sherpa-onnx>=1.10.16
3
 
4
  soundfile