Update library/safetensors_utils.py

Fix duplicated new_key for concat_hook.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Kohya S.
2026-02-11 22:36:19 +09:00
committed by GitHub
parent 82f963650b
commit 07df0e54a0

View File

@@ -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