Refactor token processing in TokenizerConfig#6912
Merged
JojiiOfficial merged 2 commits intouncouple_tokenizer_and_textindex_paramsfrom Aug 1, 2025
Merged
Refactor token processing in TokenizerConfig#6912JojiiOfficial merged 2 commits intouncouple_tokenizer_and_textindex_paramsfrom
TokenizerConfig#6912JojiiOfficial merged 2 commits intouncouple_tokenizer_and_textindex_paramsfrom
Conversation
coszio
commented
Jul 21, 2025
Comment on lines
-220
to
-235
| if self | ||
| .config | ||
| .min_token_len | ||
| .map(|min_len| token.len() < min_len && token.chars().count() < min_len) | ||
| .unwrap_or(false) | ||
| { | ||
| return; | ||
| } | ||
| if self | ||
| .config | ||
| .max_token_len | ||
| .map(|max_len| token.len() > max_len && token.chars().count() > max_len) | ||
| .unwrap_or(false) | ||
| { | ||
| return; | ||
| } |
Contributor
Author
There was a problem hiding this comment.
The only functional thing that is being changed here is that this PR checks token length only with token.chars().count(), instead of checking token.len() first.
JojiiOfficial
approved these changes
Jul 23, 2025
09bd866
into
uncouple_tokenizer_and_textindex_params
15 checks passed
generall
pushed a commit
that referenced
this pull request
Aug 3, 2025
* Refactor token processing in TokenizerConfig * fix max length checking
generall
added a commit
that referenced
this pull request
Aug 4, 2025
* Uncouple tokenizer and TextIndexParams * Refactor token processing in `TokenizerConfig` (#6912) * Refactor token processing in TokenizerConfig * fix max length checking * [Bm25] Execution implementation (#6939) * Add Bm25 * Execute BM25 if config available * cargo format * Add mocked tests for inference and bm25 * Properly apply InferenceType * Fix tests * Review remarks * Review remarks * Add overwritten model name fix again * use enum instead of multiple constants * ensure handling all fields of InferenceInput in infer_local --------- Co-authored-by: Luis Cossío <luis.cossio@outlook.com> * review fixes * fmt * spell-check * deduplicate code --------- Co-authored-by: Luis Cossío <luis.cossio@qdrant.com> Co-authored-by: Luis Cossío <luis.cossio@outlook.com> Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
timvisee
pushed a commit
that referenced
this pull request
Aug 11, 2025
* Uncouple tokenizer and TextIndexParams * Refactor token processing in `TokenizerConfig` (#6912) * Refactor token processing in TokenizerConfig * fix max length checking * [Bm25] Execution implementation (#6939) * Add Bm25 * Execute BM25 if config available * cargo format * Add mocked tests for inference and bm25 * Properly apply InferenceType * Fix tests * Review remarks * Review remarks * Add overwritten model name fix again * use enum instead of multiple constants * ensure handling all fields of InferenceInput in infer_local --------- Co-authored-by: Luis Cossío <luis.cossio@outlook.com> * review fixes * fmt * spell-check * deduplicate code --------- Co-authored-by: Luis Cossío <luis.cossio@qdrant.com> Co-authored-by: Luis Cossío <luis.cossio@outlook.com> Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
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.
Depends on #6891
This is a nice-to-have refactor of token processing, which centralizes the processing of all tokenizer options in a single place which applies all the configured ones.