Skip to content

Commit 75268c0

Browse files
committed
check
1 parent c8d4a1c commit 75268c0

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/diffusers/loaders/lora_pipeline.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2465,10 +2465,11 @@ def _maybe_expand_lora_state_dict(cls, transformer, lora_state_dict):
24652465
if k in unexpected_modules:
24662466
continue
24672467

2468-
base_param_name = f"{k.replace(prefix, '')}.weight"
2469-
base_layer_name = f"{k.replace(prefix, '')}.base_layer.weight"
2470-
if is_peft_loaded and base_layer_name in transformer_state_dict:
2471-
base_param_name = base_layer_name
2468+
base_param_name = (
2469+
f"{k.replace(prefix, '')}.base_layer.weight"
2470+
if is_peft_loaded and f"{k.replace(prefix, '')}.base_layer.weight" in transformer_state_dict
2471+
else f"{k.replace(prefix, '')}.weight"
2472+
)
24722473
base_weight_param = transformer_state_dict[base_param_name]
24732474
lora_A_param = lora_state_dict[f"{prefix}{k}.lora_A.weight"]
24742475

0 commit comments

Comments
 (0)