Skip to main content

wtok: rebalance training sets for whisper

PyPI Changelog Tests License

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 .

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wtok-0.6.1.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wtok-0.6.1-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file wtok-0.6.1.tar.gz.

File metadata

  • Download URL: wtok-0.6.1.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for wtok-0.6.1.tar.gz
Algorithm Hash digest
SHA256 1818c7ed042c363a875c2003d20f7074ee7e3a36afbbd90bc2c0793390edabb5
MD5 8b0b75d6fa2d744a5d8f6148f1373a2e
BLAKE2b-256 74b5f6a7cedf474bfc54d15382069e77ebc5ac584347ccc2e02f9ec291dd7abd

See more details on using hashes here.

File details

Details for the file wtok-0.6.1-py3-none-any.whl.

File metadata

  • Download URL: wtok-0.6.1-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for wtok-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fd183662b7ee2d16551be004c1a365ff865f7d065f8ac8ac0a86670514953905
MD5 f5687019b7fd3147c98dc1cb4248624e
BLAKE2b-256 5a89004e54afdded7ec9fd8fd1f7d3f739257a36187514a8bede7a8ca08855e0

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.6.1 This release

2 files

0.6

2 files

0.5.1

2 files

0.5

2 files

0.4

2 files

0.3

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page