Utilities for exporting PyTorch models and transform programs into .pt2 archives used by Wherobots model onboarding workflows.
pip install wherobots-exportfrom pathlib import Path
import torch
from wherobots_export.torch.export import save
model = torch.nn.Identity()
save(
model=model,
output_file=Path("model.pt2"),
input_shape=[1, 3, 224, 224],
device="cpu",
)This repo is configured for GitHub Actions publishing to PyPI using trusted publishing.
- Create the package on PyPI (
wherobots-export) and configure trusted publisher for this repo. - Push a tag like
v0.1.0. - The
publishworkflow builds and uploads the release.