From c32d23fe5daa4520e1c266fc63bc009b7c3579e8 Mon Sep 17 00:00:00 2001 From: CyberWon Date: Tue, 11 Jun 2024 17:44:12 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=B8=80=E4=B8=8B=E5=88=A4?= =?UTF-8?q?=E6=96=AD=E7=BA=AF=E7=AC=A6=E5=8F=B7=E6=89=80=E5=A4=84=E7=9A=84?= =?UTF-8?q?=E5=87=BD=E6=95=B0=EF=BC=8C=E6=9B=B4=E7=AC=A6=E5=8F=B7=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GPT_SoVITS/TTS_infer_pack/TextPreprocessor.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/GPT_SoVITS/TTS_infer_pack/TextPreprocessor.py b/GPT_SoVITS/TTS_infer_pack/TextPreprocessor.py index 826b41a5..08912278 100644 --- a/GPT_SoVITS/TTS_infer_pack/TextPreprocessor.py +++ b/GPT_SoVITS/TTS_infer_pack/TextPreprocessor.py @@ -61,9 +61,6 @@ class TextPreprocessor: result = [] print(i18n("############ 提取文本Bert特征 ############")) for text in tqdm(texts): - if not re.sub("\W+", "", text): - # 检测一下,如果是纯符号,就跳过。 - continue phones, bert_features, norm_text = self.segment_and_extract_feature_for_text(text, lang) if phones is None: continue @@ -97,6 +94,9 @@ class TextPreprocessor: for text in _texts: # 解决输入目标文本的空行导致报错的问题 if (len(text.strip()) == 0): + continue + if not re.sub("\W+", "", text): + # 检测一下,如果是纯符号,就跳过。 continue if (text[-1] not in splits): text += "。" if lang != "en" else "."