Prune unused tokens from LLM models
Project description
Remove all non-English tokens from the model
pip install prunetokens
prunetokens /path/to/model_directory_with_safetensors
Requirements: safetensors to read and write file. No VRAM required.
| Model | Before | After | Saved | Vocab |
|---|---|---|---|---|
| Qwen3.5-9B-AWQ-4bit | 8.5 GB | 7.0 GB | ~18% | 248k → 146k |
| MiniCPM5-1B | 2.1 GB | 1.9 GB | ~10% | 130k → 94k |
Pruned models:
UPDATE 0.1.4:
| Model | Before | After | Saved | Vocab |
|---|---|---|---|---|
| Qwen3.5-9B-AWQ-4bit | 8.5 GB | 6.8 GB | ~20% | 248k → 137k |
| Qwen-3.5-4B-AWQ | 4.1 GB | 3.5 GB | ~14% | 248k → 138k |
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
prunetokens-0.1.4.tar.gz
(5.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file prunetokens-0.1.4.tar.gz.
File metadata
- Download URL: prunetokens-0.1.4.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
63974374c5ead18849014f33471399ecb64c534a208a49d8d2dc0d5a6f803e88
|
|
| MD5 |
eb2495b4ffa7fbb2fd2fa35a3fbf71d4
|
|
| BLAKE2b-256 |
5a74d3cad1180ba9f5df2b5c318d0e8871ccdf37be1614094636fb1a700b6f02
|
File details
Details for the file prunetokens-0.1.4-py3-none-any.whl.
File metadata
- Download URL: prunetokens-0.1.4-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de97369df3fb850bccb21a903189c0d62a0157f9889db75d1ec6d6cbee1d22a0
|
|
| MD5 |
ee3539bc5a18fda001f325f9ff0d1da2
|
|
| BLAKE2b-256 |
db49a919e5c04fa3fe59b90b1350ac6c6475e6561c8e0f6fb214cf331a333367
|