Unverified Commit 1896b1f7 authored by hlky's avatar hlky Committed by GitHub
Browse files

`lora_bias` PEFT version check in `unet.load_attn_procs` (#10474)

`lora_bias` PEFT version check in `unet.load_attn_procs` path
parent b5726358
...@@ -343,6 +343,17 @@ class UNet2DConditionLoadersMixin: ...@@ -343,6 +343,17 @@ class UNet2DConditionLoadersMixin:
else: else:
if is_peft_version("<", "0.9.0"): if is_peft_version("<", "0.9.0"):
lora_config_kwargs.pop("use_dora") lora_config_kwargs.pop("use_dora")
if "lora_bias" in lora_config_kwargs:
if lora_config_kwargs["lora_bias"]:
if is_peft_version("<=", "0.13.2"):
raise ValueError(
"You need `peft` 0.14.0 at least to use `bias` in LoRAs. Please upgrade your installation of `peft`."
)
else:
if is_peft_version("<=", "0.13.2"):
lora_config_kwargs.pop("lora_bias")
lora_config = LoraConfig(**lora_config_kwargs) lora_config = LoraConfig(**lora_config_kwargs)
# adapter_name # adapter_name
......
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