-
Notifications
You must be signed in to change notification settings - Fork 15.6k
Add support for Tiny Aya Models #19611
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
Changes from all commits
a47878a
5264540
e4ec03f
1326773
ce36cfe
673b45b
ffca9e8
7f0fe9d
373da0e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -769,6 +769,12 @@ static std::vector<size_t> unicode_regex_split_custom(const std::string & text, | |
| } else if (regex_expr == "\\p{AFMoE_digits}") { | ||
| // AFMOE digit pattern - use custom implementation for proper splitting | ||
| bpe_offsets = unicode_regex_split_custom_afmoe(text, offsets); | ||
| } else if (regex_expr == "\\d{1,3}(?=(?:\\d{3})*\\b)") { | ||
| // tiny_aya digit grouping pattern from tokenizer.json: | ||
| // {"type": "Split", "pattern": {"Regex": "\\d{1,3}(?=(?:\\d{3})*\\b)"}, "behavior": "Isolated"} | ||
| // Splits digits into groups of 3 from the right (e.g., 1234567 -> 1, 234, 567) | ||
| // TODO: Revisit this regex, incase there are any subtle tokenization differences with the original regex. | ||
| bpe_offsets = unicode_regex_split_custom_afmoe(text, offsets); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These are not exactly the same though, may be subtle tokenization differences.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hmm, right, @saurabhdash2512 I didn't notice this regex is different. If you prefer fixing this later, we can leave a TODO here and go back later after the model is released
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tested this with random strings and didn't see any differences, but added a comment incase there are any edge cases I missed. |
||
| } | ||
|
|
||
| return bpe_offsets; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.