FileSamplesHub

Sample SAFETENSORS File Download

Sample safetensors file

Safetensors is a storage format for machine learning model weights, built to replace Python's pickle-based checkpoint formats (like .pt or .ckpt) that can execute arbitrary code on load. A safetensors file stores raw tensor data plus a small JSON header describing names, shapes, and dtypes — nothing executes when it's read.

It's become the default checkpoint format on the Hugging Face Hub and the PyTorch Foundation's recommended format, driven largely by that security guarantee: loading a safetensors file can't run code, unlike loading a pickle.

Use the sample below to test a safetensors reader, verify your model-loading pipeline parses the header and tensor buffer correctly, or check compatibility before swapping a checkpoint format in production.