Skip to content

Commit 47b1bf8

Browse files
committed
add one more model
1 parent db5ee39 commit 47b1bf8

4 files changed

Lines changed: 18 additions & 12 deletions

File tree

.github/workflows/export-piper.yaml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ jobs:
2020
matrix:
2121
os: [ubuntu-latest]
2222
python-version: ["3.10"]
23-
# total: ["20"]
24-
# index: [
25-
# "0", "1", "2", "3", "4", "5", "6", "7", "8", "9",
26-
# "10", "11", "12", "13", "14", "15", "16", "17", "18", "19",
27-
# ]
23+
total: ["20"]
24+
index: [
25+
"0", "1", "2", "3", "4", "5", "6", "7", "8", "9",
26+
"10", "11", "12", "13", "14", "15", "16", "17", "18", "19",
27+
]
2828
# total: ["2"]
2929
# index: ["0", "1"]
30-
total: ["1"]
31-
index: ["0"]
30+
# total: ["1"]
31+
# index: ["0"]
3232
# total: ["5"]
3333
# index: ["0", "1", "2", "3", "4"]
3434

@@ -185,6 +185,9 @@ jobs:
185185
vits-piper-zh_CN-xiao_ya-medium
186186
vits-piper-zh_CN-xiao_ya-medium-int8
187187
vits-piper-zh_CN-xiao_ya-medium-fp16
188+
vits-piper-zh_CN-chaowen-medium
189+
vits-piper-zh_CN-chaowen-medium-int8
190+
vits-piper-zh_CN-chaowen-medium-fp16
188191
)
189192
for d in ${dirs[@]}; do
190193
src=scripts/piper/release/$d

scripts/apk/generate-tts-apk-script.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,10 +278,13 @@ def get_piper_models() -> List[TtsModel]:
278278
TtsModel(model_dir="vits-piper-vi_VN-vivos-x_low"),
279279
TtsModel(model_dir="vits-piper-zh_CN-huayan-medium"),
280280
TtsModel(model_dir="vits-piper-zh_CN-xiao_ya-medium"),
281+
TtsModel(model_dir="vits-piper-zh_CN-chaowen-medium"),
281282
]
282283

283284
for m in models:
284-
if "zh_CN-xiao_ya" in m.model_dir:
285+
if "zh_CN" in m.model_dir and (
286+
"xiao_ya" in m.model_dir or "chaowen" in m.model_dir
287+
):
285288
m.lexion = f"{m.model_dir}/lexicon.txt"
286289
m.rule_fsts = f"{m.model_dir}/phone.fst,{m.model_dir}/date.fst,{m.model_dir}/number.fst"
287290
else:

scripts/piper/generate.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1651,6 +1651,7 @@ def get_vi_models():
16511651
def get_zh_models():
16521652
zh_CN = [
16531653
PiperModel(name="xiao_ya", kind="medium", sr=22050, ns=1),
1654+
PiperModel(name="chaowen", kind="medium", sr=22050, ns=1),
16541655
]
16551656

16561657
for m in zh_CN:
@@ -2144,8 +2145,7 @@ def get_all_models():
21442145
ans += get_tr_models()
21452146
ans += get_uk_models()
21462147
ans += get_vi_models()
2147-
2148-
ans = get_zh_models()
2148+
ans += get_zh_models()
21492149

21502150
for i, m in enumerate(ans):
21512151
m.index = i
@@ -2219,7 +2219,7 @@ def main():
22192219
"rule_fsts": "",
22202220
}
22212221

2222-
if m.lang == "zh_CN" and m.name == "xiao_ya":
2222+
if m.lang == "zh_CN" and m.name in ("xiao_ya", "chaowen"):
22232223
d = {
22242224
"model": f"{model_dir}/{m.model_name}",
22252225
"data_dir": "",

scripts/piper/generate.sh.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ mv -v README $dst/ || true
5757
mv -v README.md $dst/ || true
5858
mv -v LICENSE.txt $dst/ || true
5959
mv -v *.json $dst/
60-
if [[ $model_name != *zh_CN-xiao_ya-medium* ]]; then
60+
if [[ ! $model_name =~ zh_CN-(xiao_ya|chaowen)-medium ]]; then
6161
cp -a ./espeak-ng-data $dst/
6262
else
6363
cp lexicon-zh-g2pw.txt $dst/lexicon.txt

0 commit comments

Comments
 (0)