-
Notifications
You must be signed in to change notification settings - Fork 69
Add backwards-compatible support for multiple EOS tokens #305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
283c765
Add backwards-compatible support for multiple EOS tokens
hudson-ai b261ae9
cargo fmt
hudson-ai 985e344
Apply suggestions from code review
hudson-ai abed676
Add zero-initialization requirement comment to LlgTokenizerInit
hudson-ai 963d764
Introduce LlgTokenizerInitV2 and llg_new_tokenizer_v2 for ABI stability
hudson-ai ca775a5
Add struct_size field to LlgTokenizerInitV2 for forward compatibility
hudson-ai db177e9
Flatten LlgTokenizerInitV2 fields instead of embedding LlgTokenizerInit
hudson-ai 6e43159
Test both v1 and v2 C ABI in c_sample
hudson-ai bc534b3
cargo fmt
hudson-ai 4387f51
Validate EOS token IDs and fix struct_size forward compatibility
hudson-ai d65de0d
Fix struct_size check and add EOS validation in FFI path
hudson-ai 56526da
Make struct_size forward compatibility real via raw pointer
hudson-ai a7292ef
cargo fmt
hudson-ai 988365a
Fix multi-EOS in stopped/error fallbacks and TokenizerWrapper path
hudson-ai b0ec8ef
Add Rust tests for multi-EOS stopped-state mask and simplify Python test
hudson-ai 821f593
cargo fmt
hudson-ai 229cf29
Refactor from_init_v2 to avoid double factory construction
hudson-ai 1dc5bd6
Validate EOS token IDs in Python entry points
hudson-ai 88caf8b
Validate single EOS token in from_tiktoken path too
hudson-ai acbb724
cargo fmt
hudson-ai 197b628
Address remaining review comments
hudson-ai 96bb5fb
Fix mypy errors in test_matcher.py
hudson-ai ec47b5d
Guard eos_token_set() against INVALID_TOKEN and out-of-range IDs
hudson-ai 037a7b0
Use offset_of token_lens for min_size to match doc comment
hudson-ai 911534d
Merge branch 'main' into multi_eos
hudson-ai afa0241
clean up python tests a little bit
hudson-ai c15f0d4
Use std::vector instead of new[]/delete[] in c_sample
hudson-ai 3026e27
Take a single eos_tokens vector in create_tokenizer_v2
hudson-ai 724856c
Remove stale commented-out v2 snippet from create_tokenizer
hudson-ai cdfbf2d
Pre-allocate token vector capacity in byte tokenizer constructors
hudson-ai 6ee6b94
Use std::copy instead of memcpy for token byte packing
hudson-ai e941074
Replace remaining memcpy with std::copy in tokenize_callback
hudson-ai 434d169
doctest format fixes
hudson-ai 91e022d
Merge branch 'main' into multi_eos
hudson-ai ce51ebe
cbindgen
hudson-ai cc619d0
simplify from_init/from_init_v2 by delegating in a more sensible dire…
hudson-ai 5cfc057
cargo fmt
hudson-ai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.