generative-models
generative-models copied to clipboard
where CheckpointEngine?
alleged to exist:
https://github.com/Stability-AI/generative-models/blob/9d759324e914de6c96dbd1468b3a4a50243c6528/sgm/models/autoencoder.py#L49-L58
but he is not present:
when will my CheckpointEngine
return from war?
Same question! Have you handle this? Thank you !
Any update?
I'm having the same issue,Have you handle it?
Does anyone have an alternative?
You could replace the function alltogether
def apply_ckpt(self, ckpt: Union[None, str, dict]):
if ckpt is None:
return
if ckpt.endswith("ckpt"):
sd = torch.load(ckpt, map_location="cpu")["state_dict"]
elif ckpt.endswith("safetensors"):
sd = load_safetensors(ckpt)
else:
raise NotImplementedError
missing, unexpected = self.load_state_dict(sd, strict=False)
print(
f"Restored from {ckpt} with {len(missing)} missing and {len(unexpected)} unexpected keys"
)
if len(missing) > 0:
print(f"Missing Keys: {missing}")
if len(unexpected) > 0:
print(f"Unexpected Keys: {unexpected}")