Skip to content

Glossary: AI Security and Guardrails

weights_only

Also written: weights_only=True, torch.load, trust_remote_code

A PyTorch loading option that allows only tensors and basic types and refuses anything else. It is the default since PyTorch 2.6, and you should never turn it off for a file you didn't make.

Where the book teaches it

Related terms

Picklesafetensors