From 7abae557fb91f6c40a918a98fb396ed3e2d50152 Mon Sep 17 00:00:00 2001 From: RVC-Boss <129054828+RVC-Boss@users.noreply.github.com> Date: Tue, 1 Apr 2025 16:31:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=8A=A0=E8=BD=BDv3sovits?= =?UTF-8?q?=E6=A8=A1=E5=9E=8B=E7=BC=BA=E5=B0=91enc=5Fq=E5=91=8A=E8=AD=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 删除加载v3sovits模型缺少enc_q告警 --- GPT_SoVITS/TTS_infer_pack/TTS.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/GPT_SoVITS/TTS_infer_pack/TTS.py b/GPT_SoVITS/TTS_infer_pack/TTS.py index 5cd618e..1571ef7 100644 --- a/GPT_SoVITS/TTS_infer_pack/TTS.py +++ b/GPT_SoVITS/TTS_infer_pack/TTS.py @@ -462,8 +462,6 @@ class TTS: n_speakers=self.configs.n_speakers, **kwargs ) - if hasattr(vits_model, "enc_q"): - del vits_model.enc_q self.configs.is_v3_synthesizer = False else: vits_model = SynthesizerTrnV3( @@ -474,7 +472,8 @@ class TTS: ) self.configs.is_v3_synthesizer = True self.init_bigvgan() - + if "pretrained" not in weights_path and hasattr(vits_model, "enc_q"): + del vits_model.enc_q if if_lora_v3==False: print(f"Loading VITS weights from {weights_path}. {vits_model.load_state_dict(dict_s2['weight'], strict=False)}")