Skip to content

Commit c18e2eb

Browse files
committed
version check.
1 parent b57bc3a commit c18e2eb

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/diffusers/loaders/lora_pipeline.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
deprecate,
2626
get_adapter_name,
2727
get_peft_kwargs,
28+
is_peft_available,
2829
is_peft_version,
2930
is_torch_version,
3031
is_transformers_available,
@@ -42,7 +43,12 @@
4243

4344

4445
if is_torch_version(">=", "1.9.0"):
45-
if is_peft_version(">", "0.13.1") and is_transformers_version(">", "4.45.1"):
46+
if (
47+
is_peft_available()
48+
and is_peft_version(">", "0.13.1")
49+
and is_transformers_available()
50+
and is_transformers_version(">", "4.45.1")
51+
):
4652
_LOW_CPU_MEM_USAGE_DEFAULT_LORA = True
4753
else:
4854
_LOW_CPU_MEM_USAGE_DEFAULT_LORA = False

0 commit comments

Comments
 (0)