csukuangfj
commited on
Commit
•
1ebba16
1
Parent(s):
597a222
update
Browse files- vits-piper.py +8 -3
- vits-piper.sh +4 -0
vits-piper.py
CHANGED
@@ -49,8 +49,6 @@ def main():
|
|
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,6 +65,13 @@ def main():
|
|
67 |
|
68 |
config = load_config(f"{lang}-{name}-{t}.onnx")
|
69 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
print("generate tokens")
|
71 |
generate_tokens(config)
|
72 |
|
@@ -74,7 +79,7 @@ def main():
|
|
74 |
meta_data = {
|
75 |
"model_type": "vits",
|
76 |
"comment": "piper", # must be piper for models from piper
|
77 |
-
"language":
|
78 |
"voice": config["espeak"]["voice"], # e.g., en-us
|
79 |
"has_espeak": 1,
|
80 |
"n_speakers": config["num_speakers"],
|
|
|
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 |
|
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 |
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"],
|
vits-piper.sh
CHANGED
@@ -30,6 +30,10 @@ 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 |
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
|
|
|
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
|