Spaces:
Running
on
Zero
Running
on
Zero
cyz
commited on
Commit
•
225b56d
1
Parent(s):
6a3e442
FIX: 修复自然语言控制生成音频时发生错误,异常信息如下:AttributeError: 'CosyVoiceFrontEnd' object has no attribute 'en_tn_model'
Browse files
cosyvoice/cli/frontend.py
CHANGED
@@ -114,7 +114,10 @@ class CosyVoiceFrontEnd:
|
|
114 |
token_min_n=60, merge_len=20,
|
115 |
comma_split=False)]
|
116 |
else:
|
117 |
-
|
|
|
|
|
|
|
118 |
text = spell_out_number(text, self.inflect_parser)
|
119 |
texts = [i for i in split_paragraph(text, partial(self.tokenizer.encode, allowed_special=self.allowed_special), "en", token_max_n=80,
|
120 |
token_min_n=60, merge_len=20,
|
|
|
114 |
token_min_n=60, merge_len=20,
|
115 |
comma_split=False)]
|
116 |
else:
|
117 |
+
if self.use_ttsfrd:
|
118 |
+
text = self.frd.get_frd_extra_info(text, 'input')
|
119 |
+
else:
|
120 |
+
text = self.en_tn_model.normalize(text)
|
121 |
text = spell_out_number(text, self.inflect_parser)
|
122 |
texts = [i for i in split_paragraph(text, partial(self.tokenizer.encode, allowed_special=self.allowed_special), "en", token_max_n=80,
|
123 |
token_min_n=60, merge_len=20,
|