From a2d51131fd3b01d0bfcb629482bc6b43cdd8616f Mon Sep 17 00:00:00 2001 From: fofo Date: Mon, 17 Feb 2025 20:45:29 +0800 Subject: [PATCH] fix is_segment for tts --- core/utils/util.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/utils/util.py b/core/utils/util.py index 0c1b5b6ee..e06994829 100644 --- a/core/utils/util.py +++ b/core/utils/util.py @@ -35,7 +35,9 @@ def write_json_file(file_path, data): def is_segment(tokens): - if tokens[-1] in (",", ".", "?", ",", "。", "?", "!", "!", ";", ";", ":", ":"): + if tokens[-1] in (",", ".", "?", ",", "。", "?", "!", "!", ";", ";", ":", ":") and len(tokens) > 5: + return True + elif tokens[-1] in ( ".", "?", "。", "?", "!", "!", ";", ";", ): return True else: return False