Spaces:
Running
on
Zero
Running
on
Zero
passerbya
commited on
Commit
•
2f49610
1
Parent(s):
4e43a9d
半角句号会导致合成失败:RuntimeError: torch.cat(): expected a non-empty list of Tensors
Browse filestext='小明因为感冒,鼻子不通,讲话总带着齉音.'
File "/usr/local/data/CosyVoice/cosyvoice/cli/cosyvoice.py", line 62, in inference_zero_shot
return {'tts_speech': torch.concat(tts_speeches, dim=1)}
RuntimeError: torch.cat(): expected a non-empty list of Tensors
原因为self.frontend.text_normalize(tts_text, split=True)返回为空
cosyvoice/utils/frontend_utils.py
CHANGED
@@ -74,7 +74,7 @@ def split_paragraph(text: str, tokenize, lang="zh", token_max_n=80, token_min_n=
|
|
74 |
return len(tokenize(_text)) < merge_len
|
75 |
|
76 |
if lang == "zh":
|
77 |
-
pounc = ['。', '?', '!', ';', ':', '.', '?', '!', ';']
|
78 |
else:
|
79 |
pounc = ['.', '?', '!', ';', ':']
|
80 |
if comma_split:
|
|
|
74 |
return len(tokenize(_text)) < merge_len
|
75 |
|
76 |
if lang == "zh":
|
77 |
+
pounc = ['。', '?', '!', ';', ':', '、', '.', '?', '!', ';']
|
78 |
else:
|
79 |
pounc = ['.', '?', '!', ';', ':']
|
80 |
if comma_split:
|