Skip to content

Commit f07d36e

Browse files
committed
update
1 parent 1177d37 commit f07d36e

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

tests/lora/test_lora_layers_old_backend.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2285,8 +2285,8 @@ def test_sdxl_1_0_lora_fusion_efficiency(self):
22852285
lora_model_id = "hf-internal-testing/sdxl-1.0-lora"
22862286
lora_filename = "sd_xl_offset_example-lora_1.0.safetensors"
22872287

2288-
pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0")
2289-
pipe.load_lora_weights(lora_model_id, weight_name=lora_filename)
2288+
pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0", torch_dtype=torch.float16)
2289+
pipe.load_lora_weights(lora_model_id, weight_name=lora_filename, torch_dtype=torch.float16)
22902290
pipe.enable_model_cpu_offload()
22912291

22922292
start_time = time.time()
@@ -2299,13 +2299,13 @@ def test_sdxl_1_0_lora_fusion_efficiency(self):
22992299

23002300
del pipe
23012301

2302-
pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0")
2303-
pipe.load_lora_weights(lora_model_id, weight_name=lora_filename)
2302+
pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0", torch_dtype=torch.float16)
2303+
pipe.load_lora_weights(lora_model_id, weight_name=lora_filename, torch_dtype=torch.float16)
23042304
pipe.fuse_lora()
23052305
pipe.enable_model_cpu_offload()
23062306

2307-
start_time = time.time()
23082307
generator = torch.Generator().manual_seed(0)
2308+
start_time = time.time()
23092309
for _ in range(3):
23102310
pipe(
23112311
"masterpiece, best quality, mountain", output_type="np", generator=generator, num_inference_steps=2

tests/lora/test_lora_layers_peft.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1934,14 +1934,14 @@ def test_sdxl_1_0_lora_fusion_efficiency(self):
19341934
pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0", torch_dtype=torch.float16)
19351935
pipe.load_lora_weights(lora_model_id, weight_name=lora_filename, torch_dtype=torch.float16)
19361936
pipe.fuse_lora()
1937+
19371938
# We need to unload the lora weights since in the previous API `fuse_lora` led to lora weights being
19381939
# silently deleted - otherwise this will CPU OOM
19391940
pipe.unload_lora_weights()
1940-
19411941
pipe.enable_model_cpu_offload()
19421942

1943-
start_time = time.time()
19441943
generator = torch.Generator().manual_seed(0)
1944+
start_time = time.time()
19451945
for _ in range(3):
19461946
pipe(
19471947
"masterpiece, best quality, mountain", output_type="np", generator=generator, num_inference_steps=2

0 commit comments

Comments
 (0)