-
Notifications
You must be signed in to change notification settings - Fork 311
Add Devstral Small 1.1 #2468
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
Open
omkar-334
wants to merge
8
commits into
keras-team:master
Choose a base branch
from
omkar-334:devstral_1_1
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+26
−2
Open
Add Devstral Small 1.1 #2468
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
61cbf9f
add devstral in preset_map
omkar-334 abf1276
changes for devstral tokenizer
omkar-334 64107d0
edit hf tokenizer for devstral
omkar-334 70a8bc8
add preset
omkar-334 59df4e4
linting fixes
omkar-334 1325743
Update keras_hub/src/utils/transformers/convert_mistral.py
omkar-334 71d1b9f
Update tools/checkpoint_conversion/convert_mistral_checkpoints.py
omkar-334 0ee78e2
fix
omkar-334 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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we use
tekken.jsonsince they have mentionedTokenizer: Utilizes a Tekken tokenizer with a 131k vocabulary size.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we would need to add a dependancy on
https://github.com/mistralai/mistral-commonsince transformersAutotokenizerdoes not supporttekken.jsonThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it, they have mentioned going forward they will only use tekken.json, what difference is between tokenizer.json from base model to devstral's tekken.json?
As I observed they included
tokenizer.jsonalso in the today's release of Devstral 2 model.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If adding dependency is required by observing other models of mistral, if they only have tekken.json like this model, then we can think of adding dependency.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think they are including
tokenizer.jsonso that people can continue using them until frameworks support tekken.jsonThis is the current state of their tokenizer formats for newer models -
tekken.json(Add Devstral Small 1.1 #2333)tekken.json,tokenizer.jsontekken.json,tokenizer.jsontekken.json,tokenizer.json(Add Mistral-Small-3.1 #2334)tekken.json,tokenizer.jsontekken.json(Add Magistral to Keras-Hub #2314)tekken.json(Add Voxtral #2349)Older Models -
keras-hubincludetokenizer.modelandtokenizer.json.keras-hubimplementation loads the tokenizer usingtokenizer.modelfile format.My earlier changes do not work since we don't use the
tokenizer.jsonformat.Going forward, we need to use
tekken.jsontransformershas started supporting thetekkentokenizer and has used themistral-commonas its backend for the Mistral models. (https://github.com/huggingface/transformers/blob/471d7ce9abbb3bc1b3bab673367378f9dbc3caac/src/transformers/tokenization_mistral_common.py)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, Thanks for putting all the details here. if
Autotokenizeris supportingtekken.jsonloading, we can handle with if else condition.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, we can do that for hf_tokenizer, but how to support it in Keras-hub? Should we write a NewMistralTokenizer for
tekken.jsonbased models?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can add the underlying
TikTokenizerimplementation to Keras Hub here https://github.com/keras-team/keras-hub/tree/master/keras_hub/src/tokenizers unless NewMistralTokenizer is different than theTikTokenizer.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And an option to use base
TikTokenizerin the Mistral model here https://github.com/keras-team/keras-hub/blob/master/keras_hub/src/models/mistral/mistral_tokenizer.py.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I'll work on that and update this. Till then I'll mark this PR as draft.
thanks !