diff --git a/GPT_SoVITS/TTS_infer_pack/text_segmentation_method.py b/GPT_SoVITS/TTS_infer_pack/text_segmentation_method.py index 2a182b2..eb25610 100644 --- a/GPT_SoVITS/TTS_infer_pack/text_segmentation_method.py +++ b/GPT_SoVITS/TTS_infer_pack/text_segmentation_method.py @@ -82,7 +82,8 @@ def cut1(inp): inp = inp.strip("\n") inps = split(inp) split_idx = list(range(0, len(inps), 4)) - split_idx[-1] = None + # split_idx[-1] = None + split_idx.append(None) if len(split_idx) > 1: opts = [] for idx in range(len(split_idx) - 1): @@ -135,7 +136,8 @@ def cut5(inp): # if not re.search(r'[^\w\s]', inp[-1]): # inp += '。' inp = inp.strip("\n") - punds = r'[,.;?!、,。?!;:…]' + # punds = r'[,.;?!、,。?!;:…]' + punds = r'[,.;?!、,。?!;::…]' items = re.split(f'({punds})', inp) mergeitems = ["".join(group) for group in zip(items[::2], items[1::2])] # 在句子不存在符号或句尾无符号的时候保证文本完整 @@ -149,4 +151,4 @@ def cut5(inp): if __name__ == '__main__': method = get_method("cut5") print(method("你好,我是小明。你好,我是小红。你好,我是小刚。你好,我是小张。")) - \ No newline at end of file +