Skip to main content

Chat Tokenizer

Project description

chat-tokenizer

Usage

from chat_tokenizer import ChatTokenizer
from transformers import AutoTokenizer


tokenizer = ChatTokenizer(AutoTokenizer.from_pretrained("qwen/Qwen2.5-0.5B-Instruct"))

audio_lens = [[4, 2], 3]
labels = [["今天天气不错", "哈哈"], "你好啊"]
input_ids, input_lens, label_ids, label_lens = tokenizer.batch_tokenize(audio_lens, labels)
input_ids = tokenizer.fill_labels(label_ids, input_ids)

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

chat_tokenizer-0.0.9-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file chat_tokenizer-0.0.9-py3-none-any.whl.

File metadata

  • Download URL: chat_tokenizer-0.0.9-py3-none-any.whl
  • Upload date:
  • Size: 8.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for chat_tokenizer-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 a4ba61797c754517cf0b15c06ea869cc3e5c53686ac824df7d96ccda5f4a42d7
MD5 0ef9b804c34b64b3863ab9055c37b2f7
BLAKE2b-256 5f95a7c094ee88e9dfa870e6cce0f333a2899f23f2c9445e82754f6cf529e5f6

See more details on using hashes here.

Supported by

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