wtok: rebalance training sets for whisper
Count and truncate text based on tokens one sentence at a time
Background
Whisper models conditional distributions of a token given a sequence of past tokens
This tool can count tokens, using OpenAI's tiktoken library.
It can also truncate text to a specified number of tokens.
Installation
Install this tool using pip:
pip install wtok
Development
To contribute to this tool, first checkout the code. Then create a new virtual environment:
cd wtok
python -m venv venv
source venv/bin/activate
Now install for editing:
pip install -e .
Metadata
Release files for wtok 0.6.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| wtok-0.6.1.tar.gz | 8.5 kB | Without provenance | Details for wtok-0.6.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| wtok-0.6.1-py3-none-any.whl | Python 3 | none | any | Details for wtok-0.6.1-py3-none-any.whl |
Total release size: 17.4 kB
Release files / wtok-0.6.1.tar.gz
| Download URL | wtok-0.6.1.tar.gz |
|---|---|
| Size | 8.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1818c7ed042c363a875c2003d20f7074ee7e3a36afbbd90bc2c0793390edabb5
|
|
BLAKE2b-256 checksum How to use checksums |
74b5f6a7cedf474bfc54d15382069e77ebc5ac584347ccc2e02f9ec291dd7abd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.0 CPython/3.12.4
|
Release files / wtok-0.6.1-py3-none-any.whl
| Download URL | wtok-0.6.1-py3-none-any.whl |
|---|---|
| Size | 9.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fd183662b7ee2d16551be004c1a365ff865f7d065f8ac8ac0a86670514953905
|
|
BLAKE2b-256 checksum How to use checksums |
5a89004e54afdded7ec9fd8fd1f7d3f739257a36187514a8bede7a8ca08855e0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.0 CPython/3.12.4
|
Security for wtok 0.6.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.