> ## Documentation Index
> Fetch the complete documentation index at: https://docs.thistle.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# Roboflow PyTorch

> Secure model verification for Roboflow PyTorch (YOLO) models

PyTorch models exported from Roboflow (e.g., YOLO `.pt` weights) can be
verified before loading with the
[secure loader](/update/get_started/secure_model_verification#secure-loader-module-thistle_secure_loaderpy):

```python theme={"dark"}
import torch
from thistle_secure_loader import secure_load

def pytorch_loader(path: str):
    return torch.load(path, map_location="cpu")

model = secure_load("best.pt", pytorch_loader)
print("PyTorch model verified.")
```

The `secure_load` call verifies the `.pt` file's signature using `tuc` before
passing it to `torch.load`. If the signature check fails, a
`ModelVerificationError` is raised and the model is never loaded.

### Requirements

```txt theme={"dark"}
torch>=2.0.0
```
