Spaces:
Running
on
Zero
Running
on
Zero
Merge pull request #450 from zhuzizyf/optimize-TN
Browse files
cosyvoice/cli/frontend.py
CHANGED
@@ -118,10 +118,10 @@ class CosyVoiceFrontEnd:
|
|
118 |
text = text.replace("\n", "")
|
119 |
text = replace_blank(text)
|
120 |
text = replace_corner_mark(text)
|
121 |
-
text = text.replace(".", "
|
122 |
text = text.replace(" - ", ",")
|
123 |
text = remove_bracket(text)
|
124 |
-
text = re.sub(r'[
|
125 |
texts = list(split_paragraph(text, partial(self.tokenizer.encode, allowed_special=self.allowed_special), "zh", token_max_n=80,
|
126 |
token_min_n=60, merge_len=20, comma_split=False))
|
127 |
else:
|
|
|
118 |
text = text.replace("\n", "")
|
119 |
text = replace_blank(text)
|
120 |
text = replace_corner_mark(text)
|
121 |
+
text = text.replace(".", "。")
|
122 |
text = text.replace(" - ", ",")
|
123 |
text = remove_bracket(text)
|
124 |
+
text = re.sub(r'[,,、]+$', '。', text)
|
125 |
texts = list(split_paragraph(text, partial(self.tokenizer.encode, allowed_special=self.allowed_special), "zh", token_max_n=80,
|
126 |
token_min_n=60, merge_len=20, comma_split=False))
|
127 |
else:
|