3636
3737class DreamBoothLoRA (ExamplesTestsAccelerate ):
3838 def test_dreambooth_lora (self ):
39- with tempfile .TemporaryDirectory () as tmpdir :
39+ with tempfile .TemporaryDirectory (ignore_cleanup_errors = True ) as tmpdir :
4040 test_args = f"""
4141 examples/dreambooth/train_dreambooth_lora.py
4242 --pretrained_model_name_or_path hf-internal-testing/tiny-stable-diffusion-pipe
@@ -68,7 +68,7 @@ def test_dreambooth_lora(self):
6868 self .assertTrue (starts_with_unet )
6969
7070 def test_dreambooth_lora_with_text_encoder (self ):
71- with tempfile .TemporaryDirectory () as tmpdir :
71+ with tempfile .TemporaryDirectory (ignore_cleanup_errors = True ) as tmpdir :
7272 test_args = f"""
7373 examples/dreambooth/train_dreambooth_lora.py
7474 --pretrained_model_name_or_path hf-internal-testing/tiny-stable-diffusion-pipe
@@ -102,7 +102,7 @@ def test_dreambooth_lora_with_text_encoder(self):
102102 self .assertTrue (is_correct_naming )
103103
104104 def test_dreambooth_lora_checkpointing_checkpoints_total_limit (self ):
105- with tempfile .TemporaryDirectory () as tmpdir :
105+ with tempfile .TemporaryDirectory (ignore_cleanup_errors = True ) as tmpdir :
106106 test_args = f"""
107107 examples/dreambooth/train_dreambooth_lora.py
108108 --pretrained_model_name_or_path=hf-internal-testing/tiny-stable-diffusion-pipe
@@ -125,7 +125,7 @@ def test_dreambooth_lora_checkpointing_checkpoints_total_limit(self):
125125 )
126126
127127 def test_dreambooth_lora_checkpointing_checkpoints_total_limit_removes_multiple_checkpoints (self ):
128- with tempfile .TemporaryDirectory () as tmpdir :
128+ with tempfile .TemporaryDirectory (ignore_cleanup_errors = True ) as tmpdir :
129129 test_args = f"""
130130 examples/dreambooth/train_dreambooth_lora.py
131131 --pretrained_model_name_or_path=hf-internal-testing/tiny-stable-diffusion-pipe
@@ -163,7 +163,7 @@ def test_dreambooth_lora_checkpointing_checkpoints_total_limit_removes_multiple_
163163 self .assertEqual ({x for x in os .listdir (tmpdir ) if "checkpoint" in x }, {"checkpoint-6" , "checkpoint-8" })
164164
165165 def test_dreambooth_lora_if_model (self ):
166- with tempfile .TemporaryDirectory () as tmpdir :
166+ with tempfile .TemporaryDirectory (ignore_cleanup_errors = True ) as tmpdir :
167167 test_args = f"""
168168 examples/dreambooth/train_dreambooth_lora.py
169169 --pretrained_model_name_or_path hf-internal-testing/tiny-if-pipe
@@ -200,7 +200,7 @@ def test_dreambooth_lora_if_model(self):
200200
201201class DreamBoothLoRASDXL (ExamplesTestsAccelerate ):
202202 def test_dreambooth_lora_sdxl (self ):
203- with tempfile .TemporaryDirectory () as tmpdir :
203+ with tempfile .TemporaryDirectory (ignore_cleanup_errors = True ) as tmpdir :
204204 test_args = f"""
205205 examples/dreambooth/train_dreambooth_lora_sdxl.py
206206 --pretrained_model_name_or_path hf-internal-testing/tiny-stable-diffusion-xl-pipe
@@ -232,7 +232,7 @@ def test_dreambooth_lora_sdxl(self):
232232 self .assertTrue (starts_with_unet )
233233
234234 def test_dreambooth_lora_sdxl_with_text_encoder (self ):
235- with tempfile .TemporaryDirectory () as tmpdir :
235+ with tempfile .TemporaryDirectory (ignore_cleanup_errors = True ) as tmpdir :
236236 test_args = f"""
237237 examples/dreambooth/train_dreambooth_lora_sdxl.py
238238 --pretrained_model_name_or_path hf-internal-testing/tiny-stable-diffusion-xl-pipe
@@ -268,7 +268,7 @@ def test_dreambooth_lora_sdxl_with_text_encoder(self):
268268 self .assertTrue (starts_with_unet )
269269
270270 def test_dreambooth_lora_sdxl_custom_captions (self ):
271- with tempfile .TemporaryDirectory () as tmpdir :
271+ with tempfile .TemporaryDirectory (ignore_cleanup_errors = True ) as tmpdir :
272272 test_args = f"""
273273 examples/dreambooth/train_dreambooth_lora_sdxl.py
274274 --pretrained_model_name_or_path hf-internal-testing/tiny-stable-diffusion-xl-pipe
@@ -289,7 +289,7 @@ def test_dreambooth_lora_sdxl_custom_captions(self):
289289 run_command (self ._launch_args + test_args )
290290
291291 def test_dreambooth_lora_sdxl_text_encoder_custom_captions (self ):
292- with tempfile .TemporaryDirectory () as tmpdir :
292+ with tempfile .TemporaryDirectory (ignore_cleanup_errors = True ) as tmpdir :
293293 test_args = f"""
294294 examples/dreambooth/train_dreambooth_lora_sdxl.py
295295 --pretrained_model_name_or_path hf-internal-testing/tiny-stable-diffusion-xl-pipe
@@ -313,7 +313,7 @@ def test_dreambooth_lora_sdxl_text_encoder_custom_captions(self):
313313 def test_dreambooth_lora_sdxl_checkpointing_checkpoints_total_limit (self ):
314314 pipeline_path = "hf-internal-testing/tiny-stable-diffusion-xl-pipe"
315315
316- with tempfile .TemporaryDirectory () as tmpdir :
316+ with tempfile .TemporaryDirectory (ignore_cleanup_errors = True ) as tmpdir :
317317 test_args = f"""
318318 examples/dreambooth/train_dreambooth_lora_sdxl.py
319319 --pretrained_model_name_or_path { pipeline_path }
@@ -345,7 +345,7 @@ def test_dreambooth_lora_sdxl_checkpointing_checkpoints_total_limit(self):
345345 def test_dreambooth_lora_sdxl_text_encoder_checkpointing_checkpoints_total_limit (self ):
346346 pipeline_path = "hf-internal-testing/tiny-stable-diffusion-xl-pipe"
347347
348- with tempfile .TemporaryDirectory () as tmpdir :
348+ with tempfile .TemporaryDirectory (ignore_cleanup_errors = True ) as tmpdir :
349349 test_args = f"""
350350 examples/dreambooth/train_dreambooth_lora_sdxl.py
351351 --pretrained_model_name_or_path { pipeline_path }
0 commit comments