Replies: 1 comment
-
For simple conversion of models I suggest using https://huggingface.co/spaces/safetensors/convert It should cover most of your cases and be safe (since the machine running the conversion is not yours). In general doing: from safetensors.torch import save_file
weights = torch.load("model.pt")
save_file("model.safetensors", weights) Should be ok. This will not work all the times because of tensor sharing, which is why using the scripts is going to work more often. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
As many models are serialized using "legacy" pickle format, is it possible to take an arbitrary pickle file and convert it to safetensor file format such that the converted file is now "safe" from executing arbitrary code?
Beta Was this translation helpful? Give feedback.
All reactions