Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TTS]Canton CLI, test=tts #2977

Merged
merged 2 commits into from
Mar 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions paddlespeech/cli/tts/infer.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ def __init__(self):
'tacotron2_csmsc',
'tacotron2_ljspeech',
'fastspeech2_male',
'fastspeech2_canton',
],
help='Choose acoustic model type of tts task.')
self.parser.add_argument(
Expand Down Expand Up @@ -273,7 +274,7 @@ def _init_from_path(
use_pretrained_voc = False
voc_lang = lang
# When speaker is 174 (csmsc), use csmsc's vocoder is better than aishell3's
if lang == 'mix':
if lang == 'mix' or lang == 'canton':
voc_dataset = voc[voc.rindex('_') + 1:]
if voc_dataset in {"ljspeech", "vctk"}:
voc_lang = 'en'
Expand Down Expand Up @@ -487,7 +488,7 @@ def infer(self,
# fastspeech2
else:
# multi speaker
if am_dataset in {'aishell3', 'vctk', 'mix'}:
if am_dataset in {'aishell3', 'vctk', 'mix', 'canton'}:
mel = self.am_inference(
part_phone_ids, spk_id=paddle.to_tensor(spk_id))
else:
Expand Down
18 changes: 18 additions & 0 deletions paddlespeech/resource/pretrained_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -889,6 +889,24 @@
'phone_id_map.txt',
},
},
"fastspeech2_canton-canton": {
'1.0': {
'url':
'https://paddlespeech.bj.bcebos.com/Parakeet/released_models/fastspeech2/fastspeech2_canton_ckpt_1.4.0.zip',
'md5':
'504560c082deba82120927627c900374',
'config':
'default.yaml',
'ckpt':
'snapshot_iter_140000.pdz',
'speech_stats':
'speech_stats.npy',
'phones_dict':
'phone_id_map.txt',
'speaker_dict':
'speaker_id_map.txt',
},
},
"fastspeech2_ljspeech-en": {
'1.0': {
'url':
Expand Down
1 change: 1 addition & 0 deletions tests/unit/cli/test_cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ paddlespeech tts --am tacotron2_csmsc --voc wavernn_csmsc --input "你好,欢
paddlespeech tts --am tacotron2_ljspeech --voc pwgan_ljspeech --lang en --input "Life was like a box of chocolates, you never know what you're gonna get."
paddlespeech tts --am fastspeech2_male --voc pwgan_male --lang zh --input "你好,欢迎使用百度飞桨深度学习框架!"
paddlespeech tts --am fastspeech2_male --voc pwgan_male --lang en --input "Life was like a box of chocolates, you never know what you're gonna get."
paddlespeech tts --am fastspeech2_canton --voc pwgan_aishell3 --input "各个国家有各个国家嘅国歌" --lang canton --spk_id 10

# mix tts
# The `am` must be `fastspeech2_mix`!
Expand Down