From dbfec3fc49af9d3021f2be94e02fb4a96a917579 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stardust=C2=B7=E5=87=8F?= <2225664821@qq.com> Date: Thu, 3 Aug 2023 18:37:50 +0800 Subject: [PATCH] Update chinese.py --- text/chinese.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/text/chinese.py b/text/chinese.py index d006444..2767538 100644 --- a/text/chinese.py +++ b/text/chinese.py @@ -66,7 +66,7 @@ def g2p(text): sentences = [i for i in re.split(pattern, text) if i.strip()!=''] phones, tones, word2ph = _g2p(sentences) assert sum(word2ph) == len(phones) - assert len(word2ph) == len(text) + assert len(word2ph) == len(text) #Sometimes it will crash,you can add a try-catch. phones = ['_'] + phones + ["_"] tones = [0] + tones + [0] word2ph = [1] + word2ph + [1]