csukuangfj commited on
Commit
5dabfb0
·
1 Parent(s): f2be5fa
Files changed (2) hide show
  1. vits-piper.py +3 -8
  2. vits-piper.sh +0 -4
vits-piper.py CHANGED
@@ -49,6 +49,8 @@ def main():
49
  if not lang:
50
  print("Please provide the environment variable LANG")
51
  return
 
 
52
 
53
  t = os.environ.get("TYPE", None)
54
  if not t:
@@ -65,13 +67,6 @@ def main():
65
 
66
  config = load_config(f"{lang}-{name}-{t}.onnx")
67
 
68
- if lang == "fa_en":
69
- lang_iso_name = "Persian,English"
70
- else:
71
- lang_iso_name = Lang(lang.split("_")[0]).name
72
-
73
- print(lang, lang_iso_name)
74
-
75
  print("generate tokens")
76
  generate_tokens(config)
77
 
@@ -79,7 +74,7 @@ def main():
79
  meta_data = {
80
  "model_type": "vits",
81
  "comment": "piper", # must be piper for models from piper
82
- "language": lang_iso_name,
83
  "voice": config["espeak"]["voice"], # e.g., en-us
84
  "has_espeak": 1,
85
  "n_speakers": config["num_speakers"],
 
49
  if not lang:
50
  print("Please provide the environment variable LANG")
51
  return
52
+ lang_iso = Lang(lang.split("_")[0])
53
+ print(lang, lang_iso)
54
 
55
  t = os.environ.get("TYPE", None)
56
  if not t:
 
67
 
68
  config = load_config(f"{lang}-{name}-{t}.onnx")
69
 
 
 
 
 
 
 
 
70
  print("generate tokens")
71
  generate_tokens(config)
72
 
 
74
  meta_data = {
75
  "model_type": "vits",
76
  "comment": "piper", # must be piper for models from piper
77
+ "language": lang_iso.name,
78
  "voice": config["espeak"]["voice"], # e.g., en-us
79
  "has_espeak": 1,
80
  "n_speakers": config["num_speakers"],
vits-piper.sh CHANGED
@@ -30,10 +30,6 @@ if [[ $name == gyro && $lang == fa_IR && $type == medium ]]; then
30
  wget -qq https://huggingface.co/gyroing/Persian-Piper-Model-gyro/resolve/main/fa_IR-gyro-medium.onnx
31
  wget -qq https://huggingface.co/gyroing/Persian-Piper-Model-gyro/resolve/main/fa_IR-gyro-medium.onnx.json
32
  wget -qq https://huggingface.co/gyroing/Persian-Piper-Model-gyro/resolve/main/MODEL_CARD
33
- elif [[ $name == "rezahedayatfar-ibrahimwalk" && $lang == fa_en ]]; then
34
- wget https://huggingface.co/mah92/persian-english-piper-tts-model/resolve/main/fa_en-rezahedayatfar-ibrahimwalk-medium.onnx
35
- wget https://huggingface.co/mah92/persian-english-piper-tts-model/resolve/main/fa_en-rezahedayatfar-ibrahimwalk-medium.onnx.json
36
- wget https://huggingface.co/mah92/persian-english-piper-tts-model/resolve/main/MODEL_CARD
37
  else
38
  wget -qq https://huggingface.co/rhasspy/piper-voices/resolve/main/$code/$lang/$name/$type/$lang-$name-$type.onnx
39
  wget -qq https://huggingface.co/rhasspy/piper-voices/resolve/main/$code/$lang/$name/$type/$lang-$name-$type.onnx.json
 
30
  wget -qq https://huggingface.co/gyroing/Persian-Piper-Model-gyro/resolve/main/fa_IR-gyro-medium.onnx
31
  wget -qq https://huggingface.co/gyroing/Persian-Piper-Model-gyro/resolve/main/fa_IR-gyro-medium.onnx.json
32
  wget -qq https://huggingface.co/gyroing/Persian-Piper-Model-gyro/resolve/main/MODEL_CARD
 
 
 
 
33
  else
34
  wget -qq https://huggingface.co/rhasspy/piper-voices/resolve/main/$code/$lang/$name/$type/$lang-$name-$type.onnx
35
  wget -qq https://huggingface.co/rhasspy/piper-voices/resolve/main/$code/$lang/$name/$type/$lang-$name-$type.onnx.json