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.11.tar.gz
(5.7 kB
view details)
Built Distribution
File details
Details for the file lm_checkpoints-0.1.11.tar.gz
.
File metadata
- Download URL: lm_checkpoints-0.1.11.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.2 CPython/3.10.13 Darwin/23.2.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd13b300ae4a2321108e13d32b07927478d60d80d3b4f13184be8660aee67f47 |
|
MD5 | 7215d40558fbb2f24ce1e1a6a76c9977 |
|
BLAKE2b-256 | 4351e8d565c614528261bc7a8f88928fbe72d89cdd15c78c4c21a4325302acbe |
File details
Details for the file lm_checkpoints-0.1.11-py3-none-any.whl
.
File metadata
- Download URL: lm_checkpoints-0.1.11-py3-none-any.whl
- Upload date:
- Size: 7.6 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 977865d86995f81857aecb164dda9148bc2f421882e199f70b3839c30c0155d8 |
|
MD5 | 0fa4690100b9e1555efb413de70d089e |
|
BLAKE2b-256 | d680a3bb5a4428fa9e6290a751e6eea84e91c22f170b0d9915654fd1797147ad |