-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
[Bugfix] catch AssertionError in MistralTokenizer as ValueError #16344
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
[Bugfix] catch AssertionError in MistralTokenizer as ValueError #16344
Conversation
👋 Hi! Thank you for contributing to the vLLM project. 💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels. Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run 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 either: Add 🚀 |
Perhaps this is better solved by updating |
IMO assertion errors should not be treated like user errors |
I agree with you @DarkLight1337 . However I have still to see an external PR on |
To avoid mistakenly catching assertion errors inside vLLM, can we add a try-catch block to wrap mistral tokenizer and convert assertion errors to value errors? |
Yes this is a good idea. I'll update the PR to go in that direction |
Signed-off-by: Guillaume Calmettes <[email protected]>
3038633
to
f18e9f8
Compare
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.
This should work for now. Please fix pre-commit
@DarkLight1337 I made the change you proposed and added a note to explain why we are doing an Error type conversion |
Signed-off-by: Guillaume Calmettes <[email protected]>
Signed-off-by: Guillaume Calmettes <[email protected]>
…-project#16344) Signed-off-by: Guillaume Calmettes <[email protected]> Signed-off-by: Yang Wang <[email protected]>
…-project#16344) Signed-off-by: Guillaume Calmettes <[email protected]>
…-project#16344) Signed-off-by: Guillaume Calmettes <[email protected]>
…-project#16344) Signed-off-by: Guillaume Calmettes <[email protected]> Signed-off-by: Mu Huai <[email protected]>
When the
MistralTokenizer
is used, input preprocessing is delegated tomistral-common
which usesassert
statements to stop the process if the received input is not conformed to what is expected.Currently
AssertionError
are not catched when inputs are preprocessed in vLLM and therefore sending an incorrectly formatted message array to a model relying on the MistralTokenizer will result in a500 Internal Server Error
error.This PR convert
AssertionError
from the MistralTokenizer to ValueError, so they can be properly caughtassertion error result in
500 Internal Server Error
: