Skip to content

Commit decfa3c

Browse files
FeiXie8sayakpaul
andauthored
Fix: Use incorrect temporary variable key when replacing adapter name… (#12502)
Fix: Use incorrect temporary variable key when replacing adapter name in state dict within load_lora_adapter function Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
1 parent 4830575 commit decfa3c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/diffusers/loaders/peft.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ def map_state_dict_for_hotswap(sd):
293293
# For hotswapping, we need the adapter name to be present in the state dict keys
294294
new_sd = {}
295295
for k, v in sd.items():
296-
if k.endswith("lora_A.weight") or key.endswith("lora_B.weight"):
296+
if k.endswith("lora_A.weight") or k.endswith("lora_B.weight"):
297297
k = k[: -len(".weight")] + f".{adapter_name}.weight"
298298
elif k.endswith("lora_B.bias"): # lora_bias=True option
299299
k = k[: -len(".bias")] + f".{adapter_name}.bias"

0 commit comments

Comments
 (0)