CosyVoice commited on
Commit
4a1ec98
2 Parent(s): abc6f70 2c1877a

Merge pull request #450 from zhuzizyf/optimize-TN

Browse files
Files changed (1) hide show
  1. cosyvoice/cli/frontend.py +2 -2
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'[,,]+$', '。', 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:
 
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: