"vscode:/vscode.git/clone" did not exist on "2f6351b0015a4cd610a054f973b4f75d65c83531"
Unverified Commit 5b51ad00 authored by Sayak Paul's avatar Sayak Paul Committed by GitHub
Browse files

[LoRA] fix vanilla fine-tuned lora loading. (#8691)

fix vanilla fine-tuned lora loading.
parent 10b4e354
...@@ -396,8 +396,7 @@ class LoraLoaderMixin: ...@@ -396,8 +396,7 @@ class LoraLoaderMixin:
# their prefixes. # their prefixes.
keys = list(state_dict.keys()) keys = list(state_dict.keys())
only_text_encoder = all(key.startswith(cls.text_encoder_name) for key in keys) only_text_encoder = all(key.startswith(cls.text_encoder_name) for key in keys)
if not only_text_encoder:
if any(key.startswith(cls.unet_name) for key in keys) and not only_text_encoder:
# Load the layers corresponding to UNet. # Load the layers corresponding to UNet.
logger.info(f"Loading {cls.unet_name}.") logger.info(f"Loading {cls.unet_name}.")
unet.load_attn_procs( unet.load_attn_procs(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment