-
-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Fix edge case Mistral tokenizer #10152
Conversation
👋 Hi! Thank you for contributing to the vLLM project. Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging. To run CI, PR reviewers can do one of these:
🚀 |
# Make sure special tokens will not raise | ||
tokenizer_.special_token_policy = SpecialTokenPolicy.IGNORE | ||
|
||
elif isinstance(tokenizer_, SentencePieceTokenizer): | ||
elif self.is_spm: |
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.
Is it just me or do I not see where self.is_spm
is being used here? Is L282 the only real change in this PR?
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 the rest is just to reduce LOC a bit
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.
assert isinstance(self.tokenizer, | ||
(Tekkenizer, SentencePieceTokenizer)), type( | ||
self.tokenizer) | ||
assert self.is_tekken or self.is_spm, type(self.tokenizer) |
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.
reduce LOC
assert isinstance(self.tokenizer, | ||
(Tekkenizer, SentencePieceTokenizer)), type( | ||
self.tokenizer) | ||
assert self.is_tekken or self.is_spm, type(self.tokenizer) |
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.
reduce LOC
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.
Looks good, as long as mypy still passes.
Signed-off-by: Isotr0py <[email protected]>
Signed-off-by: OmerD <[email protected]>
Signed-off-by: Loc Huynh <[email protected]>
Signed-off-by: Jee Jee Li <[email protected]>
Signed-off-by: Sumit Dubey <[email protected]>
Signed-off-by: Maxime Fournioux <[email protected]>
Signed-off-by: Tyler Michael Smith <[email protected]>
Fixes: #9907