Skip to main content

Simple library for loading checkpoints of language models.

Project description

lm-checkpoints

Simple library for dealing with language model checkpoints.

Install using pip install lm-checkpoints.

Example

Say you want to compute some metrics for all model checkpoints of Pythia 160m, but only seed 0.

from lm_checkpoints import PythiaCheckpoints

for ckpt in PythiaCheckpoints(size=160,seed=[0]):
    # Do something with ckpt.model or ckpt.tokenizer

Or if you only want to load steps 0, 1, 2, 4, 8, 16 for all available seeds:

from lm_checkpoints import PythiaCheckpoints

for ckpt in PythiaCheckpoints(size=160,step=[0, 1, 2, 4, 8, 16]):
    # Do something with ckpt.model or ckpt.tokenizer

Alternatively, you may want to load all final checkpoints of MultiBERTs:

from lm_checkpoints import MultiBERTCheckpoints

for ckpt in MultiBERTCheckpoints.final_checkpoints():
    # Do something with ckpt.model or ckpt.tokenizer

In case you don't want the checkpoints to fill up your space, use clean_cache=True to delete older checkpoints:

from lm_checkpoints import PythiaCheckpoints

for ckpt in PythiaCheckpoints(size=14,clean_cache=True):
    # Do something with ckpt.model or ckpt.tokenizer

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

lm_checkpoints-0.1.12.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

lm_checkpoints-0.1.12-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file lm_checkpoints-0.1.12.tar.gz.

File metadata

  • Download URL: lm_checkpoints-0.1.12.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.10.13 Darwin/23.2.0

File hashes

Hashes for lm_checkpoints-0.1.12.tar.gz
Algorithm Hash digest
SHA256 addd95843f14b95e1d04377d0b0278370ae90e65242b69c4a0cf81771e223e06
MD5 af00a8acf5e84ad5aaf32d5062b9b8b5
BLAKE2b-256 a197d7e861ea1d68518aa7d2ed0667c1206b0efb0ccca61e2e3ac49c15e69686

See more details on using hashes here.

File details

Details for the file lm_checkpoints-0.1.12-py3-none-any.whl.

File metadata

  • Download URL: lm_checkpoints-0.1.12-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.10.13 Darwin/23.2.0

File hashes

Hashes for lm_checkpoints-0.1.12-py3-none-any.whl
Algorithm Hash digest
SHA256 9aa2877707d8487841925f094a8d829e35ac1004823f1a240b88f5dbe2c06b47
MD5 736cdc4b9c955fce5453e32820774b43
BLAKE2b-256 38d969e7c53a9cd69d47a03c4fb6e99c55c92f7f9453e34df684817eaa9ac2b6

See more details on using hashes here.

Supported by

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