Skip to content

Commit 1a72a00

Browse files
committed
NPU Adaption for Sanna
1 parent 626e339 commit 1a72a00

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/dreambooth/train_dreambooth_lora_sana.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -982,10 +982,10 @@ def main(args):
982982
)
983983

984984
# VAE should always be kept in fp32 for SANA (?)
985-
vae.to(accelerator.device, dtype=torch.float32)
985+
vae.to(dtype=torch.float32)
986986
transformer.to(accelerator.device, dtype=weight_dtype)
987987
# because Gemma2 is particularly suited for bfloat16.
988-
text_encoder.to(accelerator.device, dtype=torch.bfloat16)
988+
text_encoder.to(dtype=torch.bfloat16)
989989

990990
# Initialize a text encoding pipeline and keep it to CPU for now.
991991
text_encoding_pipeline = SanaPipeline.from_pretrained(

0 commit comments

Comments
 (0)