Skip to content

Commit 09456cb

Browse files
committed
Test: Add assertions to verify output changes after deletion
1 parent d1b71f7 commit 09456cb

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tests/lora/utils.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@
2828
AutoencoderKL,
2929
UNet2DConditionModel,
3030
)
31+
from diffusers.hooks.group_offloading import apply_group_offloading
3132
from diffusers.utils import logging
3233
from diffusers.utils.import_utils import is_peft_available
33-
from diffusers.hooks.group_offloading import apply_group_offloading
3434

3535
from ..testing_utils import (
3636
CaptureLogger,
@@ -2403,7 +2403,8 @@ def test_lora_group_offloading_delete_adapters(self):
24032403
)
24042404

24052405
pipe.load_lora_weights(tmpdirname, adapter_name="default")
2406-
pipe(**inputs, generator=torch.manual_seed(0))
2406+
out_lora = pipe(**inputs, generator=torch.manual_seed(0))[0]
24072407
# Delete the adapter
24082408
pipe.delete_adapters("default")
2409-
pipe(**inputs, generator=torch.manual_seed(0))
2409+
out_no_lora = pipe(**inputs, generator=torch.manual_seed(0))[0]
2410+
self.assertFalse(np.allclose(out_lora, out_no_lora, atol=1e-3, rtol=1e-3))

0 commit comments

Comments
 (0)