import torch | |
from safetensors.torch import save_file | |
model = torch.load("model.pth", weights_only=False) | |
metadata = {"author": "xcx0902", "year": "2025"} | |
save_file(model.state_dict(), "model.safetensors", metadata=metadata) | |
import torch | |
from safetensors.torch import save_file | |
model = torch.load("model.pth", weights_only=False) | |
metadata = {"author": "xcx0902", "year": "2025"} | |
save_file(model.state_dict(), "model.safetensors", metadata=metadata) | |