From 48904a692d7167705fd64621ed5e4fd7a36bfb5c Mon Sep 17 00:00:00 2001 From: Aarni Koskela Date: Mon, 17 Jul 2023 09:56:35 +0300 Subject: [PATCH] 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. --- sgm/util.py | 1 - 1 file changed, 1 deletion(-) diff --git a/sgm/util.py b/sgm/util.py index 06f48a88..4820978f 100644 --- a/sgm/util.py +++ b/sgm/util.py @@ -212,7 +212,6 @@ def load_model_from_config(config, ckpt, verbose=True, freeze=True): raise NotImplementedError model = instantiate_from_config(config.model) - sd = pl_sd["state_dict"] m, u = model.load_state_dict(sd, strict=False)