File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
examples/instruct_pix2pix Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -907,7 +907,7 @@ def collate_fn(examples):
907
907
original_image = download_image (args .val_image_url )
908
908
edited_images = []
909
909
with torch .autocast (
910
- str ( accelerator . device ). replace ( ":0" , "" ) , enabled = accelerator .mixed_precision == "fp16"
910
+ "cuda" , enabled = accelerator .mixed_precision == "fp16"
911
911
):
912
912
for _ in range (args .num_validation_images ):
913
913
edited_images .append (
@@ -963,7 +963,7 @@ def collate_fn(examples):
963
963
if args .validation_prompt is not None :
964
964
edited_images = []
965
965
pipeline = pipeline .to (accelerator .device )
966
- with torch .autocast (str ( accelerator . device ). replace ( ":0" , "" ) ):
966
+ with torch .autocast ("cuda" ):
967
967
for _ in range (args .num_validation_images ):
968
968
edited_images .append (
969
969
pipeline (
You can’t perform that action at this time.
0 commit comments