Repository navigation
Conversation
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
SBrandeis
marked this pull request as ready for review
October 21, 2026 14:28
SBrandeis
added this pull request to stack #2564
October 21, 2026 14:28
SBrandeis
force-pushed
the
feat/composition-2-tokenizer-spec
branch
from
October 22, 2026 10:46
76ed13e to
11f25d5
Compare
SBrandeis
removed this pull request from stack #2564
October 22, 2026 14:17
SBrandeis
added this pull request to stack #2576
October 22, 2026 14:17
SBrandeis
marked this pull request as draft
October 22, 2026 14:19
SBrandeis
removed this pull request from stack #2576
October 22, 2026 14:51
SBrandeis
added this pull request to stack #2578
October 22, 2026 14:51
SBrandeis
removed this pull request from stack #2578
October 22, 2026 15:00
SBrandeis
added this pull request to stack #2580
October 22, 2026 15:01
SBrandeis
force-pushed
the
feat/composition-2-tokenizer-spec
branch
from
October 23, 2026 10:45
a91d1d1 to
2090802
Compare
Older tokenizer.json files leave the model's "type" out, and tk-convert infers it. The Python bindings pick a component's class from that "type", so they need the same inference. fill_model_type becomes pub and is re-exported from tk-convert and from the tokenizers umbrella crate. No behaviour change. Spec: groundwork for §1.2 (component getters return the concrete class).
Each component's JSON lives in a ComponentSpec cell (Mutex<Arc<JsonObject>>). The component handles of the next PRs share these cells, so an edit through a handle reaches the tokenizer, as in 0.23. PipelineSpec is generic over what it holds: cells in the tokenizer, a JSON snapshot in the compile cache. Copying a tokenizer gives it new cells over the same JSON. The repr's object printing moves into write_object, which component reprs reuse.
SBrandeis
force-pushed
the
feat/composition-2-tokenizer-spec
branch
from
October 23, 2026 11:07
2090802 to
4de5962
Compare
SBrandeis
marked this pull request as ready for review
October 23, 2026 11:08
CI builds all targets before fetching fixtures, so the compile-time include broke Build & Clippy on every OS.
Its only caller outside convert.rs is TokenizerJson, now in the same crate, so the public export from #2560 is no longer needed.
SBrandeis
removed this pull request from stack #2580
October 23, 2026 11:21
SBrandeis
changed the base branch from
feat/composition-1-fill-model-type
to
main
October 23, 2026 11:21
SBrandeis
added this pull request to stack #2583
October 23, 2026 11:22
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.
TL;DR
Introduce
TokenizerSpecbacking theTokenizerpyclass in the Python bindings.TokenizerSpecmirrors thetokenizer.jsonconfig in memory, and compiles aPipelineTokenizerfrom it.Benefits:
PipelineTokenizeron the next encode. Changing padding or truncation never recompiles.Arc, and a copy gets a reference to the compiled pipeline.copy.deepcopyno longer goes through__reduce__and a full re-compilation.Visuals