Add experimental Hugging Face .tok tokenizer backend - #218
Draft
JacobSzwejbka wants to merge 4 commits into
Draft
JacobSzwejbka wants to merge 4 commits into
JacobSzwejbka wants to merge 4 commits into
Conversation
Preserve independent BOS/EOS counts, avoid guessing a missing token ID, and reject .tok files whose decoder cannot yet be represented safely. Add C++ regression coverage and run the Rust checks in CI. AI-assisted-by: Codex
AI-assisted-by: Codex
Generated with assistance from Codex.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This is the experimental
.tokfollow-up to meta-pytorch/tokenizers#212. Do not merge it before #212.It adds an independently selectable
.tok-only backend and a dual JSON/.tokconfiguration. The implementation is preserved separately so the JSON integration can merge using only released Hugging Face RC crates.Dependency status
.tokis not part of Hugging Face tokenizers v1.0.0-rc.2 or its published crates. This draft pins commit054bdf469b2cf416c0da953923d88c82f4d765b5from the experimentalfeat/tok-formatbranch. It should remain draft until the format and reader land in a protected upstream branch or release.Because this is stacked on #212, GitHub currently shows the JSON base changes too. Once #212 lands and this branch is rebased, the diff will contain only
.toksupport.Validation
Before the split, the
.tok-only, JSON-only, and combined Rust configurations passed formatting, Clippy with warnings denied, unit tests, CMake builds, installed-package linkage, and real GPT-2 round trips. The.tokpath remains byte-level-only because the experimental schema does not serialize decoder chains.AI-assisted by Codex.