Skip to content

Commit a8fdc76

Browse files
committed
add warning in the test.
1 parent 114ceff commit a8fdc76

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

tests/lora/test_lora_layers_sdxl.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@
3333
StableDiffusionXLPipeline,
3434
T2IAdapter,
3535
)
36+
from diffusers.utils import logging
3637
from diffusers.utils.import_utils import is_accelerate_available
3738
from diffusers.utils.testing_utils import (
39+
CaptureLogger,
3840
load_image,
3941
nightly,
4042
numpy_cosine_similarity_distance,
@@ -620,12 +622,16 @@ def test_integration_logits_for_dora_lora(self):
620622
pipeline.load_lora_weights("hf-internal-testing/dora-trained-on-kohya")
621623
pipeline.enable_model_cpu_offload()
622624

623-
images = pipeline(
624-
"photo of ohwx dog",
625-
num_inference_steps=10,
626-
generator=torch.manual_seed(0),
627-
output_type="np",
628-
).images
625+
logger = logging.get_logger("diffusers.loaders.lora_pipeline")
626+
logger.setLevel(30)
627+
with CaptureLogger(logger) as cap_logger:
628+
images = pipeline(
629+
"photo of ohwx dog",
630+
num_inference_steps=10,
631+
generator=torch.manual_seed(0),
632+
output_type="np",
633+
).images
634+
assert "It seems like you are using a DoRA checkpoint" in cap_logger.out
629635

630636
predicted_slice = images[0, -3:, -3:, -1].flatten()
631637
expected_slice_scale = np.array([0.1817, 0.0697, 0.2346, 0.0900, 0.1261, 0.2279, 0.1767, 0.1991, 0.2886])

0 commit comments

Comments
 (0)