From 07df0e54a03982e8fa564ef1d812dd82598aee0b Mon Sep 17 00:00:00 2001 From: "Kohya S." <52813779+kohya-ss@users.noreply.github.com> Date: Wed, 11 Feb 2026 22:36:19 +0900 Subject: [PATCH] Update library/safetensors_utils.py Fix duplicated new_key for concat_hook. Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- library/safetensors_utils.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/library/safetensors_utils.py b/library/safetensors_utils.py index 701a07f2..c7a3bdd7 100644 --- a/library/safetensors_utils.py +++ b/library/safetensors_utils.py @@ -429,11 +429,10 @@ class TensorWeightAdapter: if converted_key not in self.concat_key_set: # first time seeing this concatenated key self.concat_key_set.add(converted_key) self.new_key_to_original_key_map[converted_key] = [] + self.new_keys.append(converted_key) # multiple original keys map to the same concatenated key self.new_key_to_original_key_map[converted_key].append(key) - - self.new_keys.append(converted_key) continue # skip to next key # direct mapping