Skip to content

Commit

Permalink
Update firefly.py (#295)
Browse files Browse the repository at this point in the history
[fix bug]: Ensure state_dict is defined when ckpt_path is not None
  • Loading branch information
cminusQAQ committed Jun 28, 2024
1 parent fbe2e3f commit 97e8e3c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fish_speech/models/vqgan/modules/firefly.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ def __init__(self, ckpt_path: str = None, pretrained: bool = True):
)

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",
Expand Down

0 comments on commit 97e8e3c

Please sign in to comment.