How to use save_pretrained correctly #11110
-
Hello, I need some understanding on how to use save_pretrained
Repo import torch
from diffusers import LTXConditionPipeline
import os
output_dir = "Lightricks-bf16/LTX-Video-0.9.5"
pipe = LTXConditionPipeline.from_pretrained(
"Lightricks/LTX-Video-0.9.5",
torch_dtype=torch.bfloat16
)
pipe.text_encoder = pipe.text_encoder.to(torch.bfloat16)
pipe.vae = pipe.vae.to(torch.bfloat16)
pipe.transformer = pipe.transformer.to(torch.bfloat16)
pipe.save_pretrained(
output_dir,
safe_serialization=True,
variant="bf16"
)
print("Model saved successfully!") └───LTX-Video-0.9.5 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi!, this is because the transformer model its already in bf16 while the one you're comparing it to (sana) its in FP32, you can easily check this in the HUB by clicking in the layers symbol: |
Beta Was this translation helpful? Give feedback.
Hi!, this is because the transformer model its already in bf16 while the one you're comparing it to (sana) its in FP32, you can easily check this in the HUB by clicking in the layers symbol: