File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -203,7 +203,7 @@ def log_validation(
203
203
204
204
pipeline .scheduler = DPMSolverMultistepScheduler .from_config (pipeline .scheduler .config , ** scheduler_args )
205
205
206
- pipeline = pipeline .to (accelerator .device , dtype = torch_dtype )
206
+ pipeline = pipeline .to (accelerator .device )
207
207
pipeline .set_progress_bar_config (disable = True )
208
208
209
209
# run inference
@@ -213,7 +213,7 @@ def log_validation(
213
213
if torch .backends .mps .is_available () or "playground" in args .pretrained_model_name_or_path :
214
214
autocast_ctx = nullcontext ()
215
215
else :
216
- autocast_ctx = torch .autocast (accelerator .device .type )
216
+ autocast_ctx = torch .autocast (accelerator .device .type ) if not is_final_validation else nullcontext ()
217
217
218
218
with autocast_ctx :
219
219
images = [pipeline (** pipeline_args , generator = generator ).images [0 ] for _ in range (args .num_validation_images )]
You can’t perform that action at this time.
0 commit comments