pt-loader
Safe parser-based PyTorch checkpoint converter to safetensors with both Rust and Python APIs.
Active Development Notice
pt-loader is under active development. During v0.1.x, we may introduce breaking API and behavior changes in both Rust and Python interfaces without backward-compatibility guarantees.
Features
- Parses torch zip
.ptcheckpoints with strict safety limits. - Converts checkpoints to
model.safetensors+model.yaml. - Inspects checkpoint metadata and tensor summaries.
- Loads tensors directly into Python as NumPy arrays.
Installation
Python
Install from PyPI:
Install from source (local repo):
Rust
Add dependency:
[]
= "0.1"
Python Usage
Example:
=
=
=
Rust Usage
use ;
use Path;
let input = "samples/yolo26n.pt";
let ckpt = load?;
let result = ckpt.export?;
println!;
Development