From bd5b7533538f52c273af449f7e3d3666f0d8d8cd Mon Sep 17 00:00:00 2001 From: aoguai <1340219674@qq.com> Date: Fri, 28 Jun 2024 10:52:15 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E6=8C=89=E6=A0=87?= =?UTF-8?q?=E7=82=B9=E7=AC=A6=E5=8F=B7=E5=88=87=E5=88=86=E6=97=B6=E5=B0=8F?= =?UTF-8?q?=E6=95=B0=E4=BC=9A=E8=A2=AB=E5=88=87=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GPT_SoVITS/inference_webui.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/GPT_SoVITS/inference_webui.py b/GPT_SoVITS/inference_webui.py index 4dc1040d..fcd98e37 100644 --- a/GPT_SoVITS/inference_webui.py +++ b/GPT_SoVITS/inference_webui.py @@ -510,16 +510,15 @@ def cut4(inp): # contributed by https://github.com/AI-Hobbyist/GPT-SoVITS/blob/main/GPT_SoVITS/inference_webui.py def cut5(inp): - # if not re.search(r'[^\w\s]', inp[-1]): - # inp += '。' inp = inp.strip("\n") punds = r'[,.;?!、,。?!;:…]' - items = re.split(f'({punds})', inp) + # 在标点符号前面添加了两个负向断言 (?!\d),分别表示标点符号前面不是小数点后面的数字和标点符号前面不是数字,这样可以避免小数被错误切分 + items = re.split(f'({punds})(?