Skip to content

Commit

Permalink
Merge pull request #14216 from wfjsw/state-dict-ref-comparison
Browse files Browse the repository at this point in the history
change state dict comparison to ref compare
  • Loading branch information
AUTOMATIC1111 committed Dec 14, 2023
1 parent f8871de commit eb52c80
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/sd_disable_initialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ def load_state_dict(original, module, state_dict, strict=True):
would be on the meta device.
"""

if state_dict == sd:
if state_dict is sd:
state_dict = {k: v.to(device="meta", dtype=v.dtype) for k, v in state_dict.items()}

original(module, state_dict, strict=strict)
Expand Down

0 comments on commit eb52c80

Please sign in to comment.