Skip to content

Commit a6d8f3f

Browse files
committed
revert changes in LoRA base.
1 parent 5c4976b commit a6d8f3f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/diffusers/loaders/lora_base.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -344,10 +344,6 @@ def _load_lora_into_text_encoder(
344344

345345
# Safe prefix to check with.
346346
if any(text_encoder_name in key for key in keys):
347-
# adapter_name
348-
if adapter_name is None:
349-
adapter_name = get_adapter_name(text_encoder)
350-
351347
# Load the layers corresponding to text encoder and make necessary adjustments.
352348
text_encoder_keys = [k for k in keys if k.startswith(prefix) and k.split(".")[0] == prefix]
353349
text_encoder_lora_state_dict = {
@@ -404,6 +400,10 @@ def _load_lora_into_text_encoder(
404400

405401
lora_config = LoraConfig(**lora_config_kwargs)
406402

403+
# adapter_name
404+
if adapter_name is None:
405+
adapter_name = get_adapter_name(text_encoder)
406+
407407
is_model_cpu_offload, is_sequential_cpu_offload = _func_optionally_disable_offloading(_pipeline)
408408

409409
# inject LoRA layers and load the state dict

0 commit comments

Comments
 (0)