From 89256b103da3cb9893737fb5d7436f7c1213b0cc Mon Sep 17 00:00:00 2001 From: Songyuanwei <52945530+Songyuanwei@users.noreply.github.com> Date: Thu, 29 Aug 2024 14:26:37 +0800 Subject: [PATCH] fix sd model convert bug (#644) --- .../tools/model_conversion/convert_weights.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/stable_diffusion_v2/tools/model_conversion/convert_weights.py b/examples/stable_diffusion_v2/tools/model_conversion/convert_weights.py index a189f9d961..f8bd6833d8 100644 --- a/examples/stable_diffusion_v2/tools/model_conversion/convert_weights.py +++ b/examples/stable_diffusion_v2/tools/model_conversion/convert_weights.py @@ -52,7 +52,7 @@ def _load_torch_ckpt(ckpt_file): source_data = torch.load(ckpt_file, map_location="cpu") - if ["state_dict"] in source_data: + if "state_dict" in source_data: source_data = source_data["state_dict"] return source_data