Skip to content

Commit 97e8e3c

Browse files
authored
Update firefly.py (#295)
[fix bug]: Ensure state_dict is defined when ckpt_path is not None
1 parent fbe2e3f commit 97e8e3c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fish_speech/models/vqgan/modules/firefly.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ def __init__(self, ckpt_path: str = None, pretrained: bool = True):
500500
)
501501

502502
if ckpt_path is not None:
503-
self.load_state_dict(torch.load(ckpt_path, map_location="cpu"))
503+
state_dict = torch.load(ckpt_path, map_location="cpu")
504504
elif pretrained:
505505
state_dict = torch.hub.load_state_dict_from_url(
506506
"https://github.com/fishaudio/vocoder/releases/download/1.0.0/firefly-gan-base-generator.ckpt",

0 commit comments

Comments
 (0)