diff --git a/GPT_SoVITS/inference_webui.py b/GPT_SoVITS/inference_webui.py index a3531a69..3a1d62cd 100644 --- a/GPT_SoVITS/inference_webui.py +++ b/GPT_SoVITS/inference_webui.py @@ -246,7 +246,6 @@ def nonen_clean_text_inf(text, language): return phones, word2ph, norm_text - def nonen_get_bert_inf(text, language): textlist, langlist = splite_en_inf(text, language) print(textlist) @@ -446,6 +445,8 @@ def cut4(inp): return "\n".join(["%s." % item for item in inp.strip(".").split(".")]) 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) @@ -454,6 +455,8 @@ def cut5(inp): return opt def cut6(inp): + if not re.search(r'[^\w\s]', inp[-1]): + inp += '.' inp = inp.strip("\n") punds = r'[,.;?!]' items = re.split(f'({punds})', inp) diff --git a/gweight.txt b/gweight.txt new file mode 100644 index 00000000..6a330d58 --- /dev/null +++ b/gweight.txt @@ -0,0 +1 @@ +GPT_weights/na_xi_da-e50.ckpt \ No newline at end of file diff --git a/sweight.txt b/sweight.txt new file mode 100644 index 00000000..3765f316 --- /dev/null +++ b/sweight.txt @@ -0,0 +1 @@ +SoVITS_weights/na_xi_da_e20_s2020.pth \ No newline at end of file diff --git a/test.py b/test.py new file mode 100644 index 00000000..7ad88214 --- /dev/null +++ b/test.py @@ -0,0 +1,17 @@ +import re + +def add_period(text): + if not re.search(r'[^\w\s]', text[-1]): + text += '。' + return text + +def cut5(inp): + inp = add_period(inp) + inp = inp.strip("\n") + punds = r'[、,。?!;:]' + items = re.split(f'({punds})', inp) + items = ["".join(group) for group in zip(items[::2], items[1::2])] + opt = "\n".join(items) + return opt + +print(cut5("测试")) \ No newline at end of file