Skip to content

Commit

Permalink
[LoRA] fix vanilla fine-tuned lora loading. (#8691)
Browse files Browse the repository at this point in the history
fix vanilla fine-tuned lora loading.
  • Loading branch information
sayakpaul committed Jun 27, 2024
1 parent 64b2050 commit 1479729
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/diffusers/loaders/lora.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,7 @@ def load_lora_into_unet(cls, state_dict, network_alphas, unet, adapter_name=None
# their prefixes.
keys = list(state_dict.keys())
only_text_encoder = all(key.startswith(cls.text_encoder_name) for key in keys)

if any(key.startswith(cls.unet_name) for key in keys) and not only_text_encoder:
if not only_text_encoder:
# Load the layers corresponding to UNet.
logger.info(f"Loading {cls.unet_name}.")
unet.load_attn_procs(
Expand Down

0 comments on commit 1479729

Please sign in to comment.