ソースを参照

FIX: 修复自然语言控制生成音频时发生错误,异常信息如下:AttributeError: 'CosyVoiceFrontEnd' object has no attribute 'en_tn_model'

cyz 1 年間 前
コミット
225b56de05
1 ファイル変更4 行追加1 行削除
  1. 4 1
      cosyvoice/cli/frontend.py

+ 4 - 1
cosyvoice/cli/frontend.py

@@ -114,7 +114,10 @@ class CosyVoiceFrontEnd:
                                                 token_min_n=60, merge_len=20,
                                                 comma_split=False)]
         else:
-            text = self.en_tn_model.normalize(text)
+            if self.use_ttsfrd:
+                text = self.frd.get_frd_extra_info(text, 'input')
+            else:
+                text = self.en_tn_model.normalize(text)
             text = spell_out_number(text, self.inflect_parser)
             texts = [i for i in split_paragraph(text, partial(self.tokenizer.encode, allowed_special=self.allowed_special), "en", token_max_n=80,
                                                 token_min_n=60, merge_len=20,