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
Project details
Release history Release notifications | RSS feed
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.8.tar.gz
(5.6 kB
view details)
Built Distribution
File details
Details for the file lm_checkpoints-0.1.8.tar.gz
.
File metadata
- Download URL: lm_checkpoints-0.1.8.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.2 CPython/3.10.13 Darwin/23.1.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 08d55bed6446f4f3529dae00372ab687157faab7334af102aed10b30ec44f3da |
|
MD5 | 366d9b84097d3e76f483624032dc4bf8 |
|
BLAKE2b-256 | a2d0e5ac6d31d17da9d9b2652133d2afef3448d9cc9cabcbfdae813f76f19094 |
File details
Details for the file lm_checkpoints-0.1.8-py3-none-any.whl
.
File metadata
- Download URL: lm_checkpoints-0.1.8-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.2 CPython/3.10.13 Darwin/23.1.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e3d3e722c010a263f0f159aa7438646c618ab765a67a98db13bf4dba9f77fff7 |
|
MD5 | 3b7ed533158a54122692ae15ac5df010 |
|
BLAKE2b-256 | 9e65ecb2b58d2cb07936f0435a386b1ddeb5f0ec4156a8f475f42a0c28a25a89 |