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.1.tar.gz (4.6 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.1-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ptloader-0.2.1.tar.gz
  • Upload date:
  • Size: 4.6 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.1.tar.gz
Algorithm Hash digest
SHA256 e63a275129d20b0aa51c096d7579b3ced3ec8307a8747197a997f8207fb8e330
MD5 be73a8f602ebe5d8e73ae0ec764ff675
BLAKE2b-256 9cb063ed65bc378026acd8a598d88fc656cae1070878be8aa7f101a5d405440b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ptloader-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 5.5 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0c4c2d3a5f6d1b086fc7717d131c45c6bae8e346b193959a4bd63e0900f13846
MD5 4a6439a7d04cb71b5c020c1b906cab37
BLAKE2b-256 f7792dc9277f4982fd15ff305168833c28fe614d9f1cd57325cb2c093aa84ae4

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