mirror of
https://github.com/Stability-AI/generative-models.git
synced 2025-12-19 22:34:22 +01:00
Fix loading safetensors with load_model_from_config
Previously, the `sd` from the safetensors if branch was not used at all, and `pl_sd` would have not been assigned.
This commit is contained in:
@@ -212,7 +212,6 @@ def load_model_from_config(config, ckpt, verbose=True, freeze=True):
|
|||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
model = instantiate_from_config(config.model)
|
model = instantiate_from_config(config.model)
|
||||||
sd = pl_sd["state_dict"]
|
|
||||||
|
|
||||||
m, u = model.load_state_dict(sd, strict=False)
|
m, u = model.load_state_dict(sd, strict=False)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user