Skip to main content

Load torch checkpoints as NumPy arrays without torch at runtime.

Project description

ptloader

Load zip-based PyTorch checkpoints as NumPy arrays, without installing torch at runtime.

Quickstart

uv add ptloader
import ptloader

state = ptloader.load("model.pt")
print(type(state["layer.weight"]))  # numpy.ndarray

ptloader.load(...) supports str | pathlib.Path | BinaryIO and converts tensors to numpy.ndarray while preserving nested container structure.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ptloader-0.2.0.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ptloader-0.2.0-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file ptloader-0.2.0.tar.gz.

File metadata

  • Download URL: ptloader-0.2.0.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ptloader-0.2.0.tar.gz
Algorithm Hash digest
SHA256 300b5df609207e5236d380d1a4b162c89115a049d469e1d2c9df936d9d222af3
MD5 493314ec2e94c11c1ad0a90663b279d8
BLAKE2b-256 44f54d62cef37f8333884374592367b22d929976936cdff70e18d833014af51b

See more details on using hashes here.

File details

Details for the file ptloader-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: ptloader-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ptloader-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b2e0b2fd3f4ee67ed3c9d51e715be0510b7ae19c76a392512267080439e5f65e
MD5 d73e7a14b0da1c729a48200186fb6422
BLAKE2b-256 4a555dc2b80cdf3fe718ac95a0cef3279082a196078b656bf136842f5e1a3c31

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page