File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments