From 2f496104ecc7e79627bb17d5d7ac3c2d4cbff539 Mon Sep 17 00:00:00 2001 From: passerbya Date: Tue, 9 Jul 2024 08:17:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=8A=E8=A7=92=E5=8F=A5=E5=8F=B7=E4=BC=9A?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E5=90=88=E6=88=90=E5=A4=B1=E8=B4=A5=EF=BC=9A?= =?UTF-8?q?RuntimeError:=20torch.cat():=20expected=20a=20non-empty=20list?= =?UTF-8?q?=20of=20Tensors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit text='小明因为感冒,鼻子不通,讲话总带着齉音.' 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cosyvoice/utils/frontend_utils.py b/cosyvoice/utils/frontend_utils.py index dee829f..bcd637c 100644 --- a/cosyvoice/utils/frontend_utils.py +++ b/cosyvoice/utils/frontend_utils.py @@ -74,7 +74,7 @@ def split_paragraph(text: str, tokenize, lang="zh", token_max_n=80, token_min_n= return len(tokenize(_text)) < merge_len if lang == "zh": - pounc = ['。', '?', '!', ';', ':', '.', '?', '!', ';'] + pounc = ['。', '?', '!', ';', ':', '、', '.', '?', '!', ';'] else: pounc = ['.', '?', '!', ';', ':'] if comma_split: