Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
renzhc
diffusers_dcu
Commits
20273e55
Unverified
Commit
20273e55
authored
Jun 02, 2025
by
Sayak Paul
Committed by
GitHub
Jun 02, 2025
Browse files
[tests] chore: rename lora model-level tests. (#11481)
chore: rename lora model-level tests.
parent
d4dc4d76
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
tests/models/test_modeling_common.py
tests/models/test_modeling_common.py
+2
-2
No files found.
tests/models/test_modeling_common.py
View file @
20273e55
...
@@ -1060,7 +1060,7 @@ class ModelTesterMixin:
...
@@ -1060,7 +1060,7 @@ class ModelTesterMixin:
@
parameterized
.
expand
([
True
,
False
])
@
parameterized
.
expand
([
True
,
False
])
@
torch
.
no_grad
()
@
torch
.
no_grad
()
@
unittest
.
skipIf
(
not
is_peft_available
(),
"Only with PEFT"
)
@
unittest
.
skipIf
(
not
is_peft_available
(),
"Only with PEFT"
)
def
test_save_load_
lora_
adapter
(
self
,
use_dora
=
False
):
def
test_
lora_
save_load_adapter
(
self
,
use_dora
=
False
):
import
safetensors
import
safetensors
from
peft
import
LoraConfig
from
peft
import
LoraConfig
from
peft.utils
import
get_peft_model_state_dict
from
peft.utils
import
get_peft_model_state_dict
...
@@ -1117,7 +1117,7 @@ class ModelTesterMixin:
...
@@ -1117,7 +1117,7 @@ class ModelTesterMixin:
self
.
assertTrue
(
torch
.
allclose
(
outputs_with_lora
,
outputs_with_lora_2
,
atol
=
1e-4
,
rtol
=
1e-4
))
self
.
assertTrue
(
torch
.
allclose
(
outputs_with_lora
,
outputs_with_lora_2
,
atol
=
1e-4
,
rtol
=
1e-4
))
@
unittest
.
skipIf
(
not
is_peft_available
(),
"Only with PEFT"
)
@
unittest
.
skipIf
(
not
is_peft_available
(),
"Only with PEFT"
)
def
test_wrong_adapter_name_raises_error
(
self
):
def
test_
lora_
wrong_adapter_name_raises_error
(
self
):
from
peft
import
LoraConfig
from
peft
import
LoraConfig
from
diffusers.loaders.peft
import
PeftAdapterMixin
from
diffusers.loaders.peft
import
PeftAdapterMixin
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment