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.3.0.tar.gz (4.5 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.3.0-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ptloader-0.3.0.tar.gz
  • Upload date:
  • Size: 4.5 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.3.0.tar.gz
Algorithm Hash digest
SHA256 4d97502aea650c0f9b2ec6f8c0563f9483829aedcbc1951392bd58a6c79e0bfd
MD5 07e904e9bff4c40267580212468451a4
BLAKE2b-256 a6e67be97b01d4fb7c4989d42f8229f8546f69730ea05ceea56015c86530602b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ptloader-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 5.4 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.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 08bceef691a5c5fa8e7dd21563e0c8d2e0e3b5bfc0169570a0fe8bd6295300b8
MD5 2cbc91fda2fb813ae4ecf8ffd44e3ab9
BLAKE2b-256 e0a8cd541220b579ebc8b8a3f490882c7329c81932c1a30004991ecdfc4d3a0e

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