소스 검색

Update firefly.py (#295)

[fix bug]: Ensure state_dict is defined when ckpt_path is not None
cminus 1 년 전
부모
커밋
97e8e3c491
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      fish_speech/models/vqgan/modules/firefly.py

+ 1 - 1
fish_speech/models/vqgan/modules/firefly.py

@@ -500,7 +500,7 @@ class FireflyBase(nn.Module):
         )
 
         if ckpt_path is not None:
-            self.load_state_dict(torch.load(ckpt_path, map_location="cpu"))
+            state_dict = torch.load(ckpt_path, map_location="cpu")
         elif pretrained:
             state_dict = torch.hub.load_state_dict_from_url(
                 "https://github.com/fishaudio/vocoder/releases/download/1.0.0/firefly-gan-base-generator.ckpt",