-
-
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
[Bugfix] Ensure special tokens are properly filtered out for guided structured output with MistralTokenizer #10363
[Bugfix] Ensure special tokens are properly filtered out for guided structured output with MistralTokenizer #10363
Conversation
Signed-off-by: Guillaume Calmettes <gcalmettes@scaleway.com>
Signed-off-by: Guillaume Calmettes <gcalmettes@scaleway.com>
👋 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:
🚀 |
@DarkLight1337 it's a follow up of #10333 |
cc @simon-mo |
@DarkLight1337 unfortunately, we did not get lucky and got timed-out on the |
…tructured output with MistralTokenizer (vllm-project#10363) Signed-off-by: Guillaume Calmettes <gcalmettes@scaleway.com>
…tructured output with MistralTokenizer (vllm-project#10363) Signed-off-by: Guillaume Calmettes <gcalmettes@scaleway.com> Signed-off-by: Maxime Fournioux <55544262+mfournioux@users.noreply.github.com>
…tructured output with MistralTokenizer (vllm-project#10363) Signed-off-by: Guillaume Calmettes <gcalmettes@scaleway.com> Signed-off-by: rickyx <rickyx@anyscale.com>
…tructured output with MistralTokenizer (vllm-project#10363) Signed-off-by: Guillaume Calmettes <gcalmettes@scaleway.com> Signed-off-by: Tyler Michael Smith <tyler@neuralmagic.com>
…tructured output with MistralTokenizer (vllm-project#10363) Signed-off-by: Guillaume Calmettes <gcalmettes@scaleway.com>
This PR improves the support of the vllm
MistralTokenizer
with the guided structured output functionalities.In particular:
lm-format-enforcer
is bumped to the latest version, so it includes the support of the vllm MistralTokenizer (feat: add support for vLLM Mistral Tokenizer noamgat/lm-format-enforcer#142)MistralTokenizer
methods leveraged by the structured output libraries are now properly populated so that the list of possible tokens generated based on the chosen grammar/constraints (e.g.:json
output) correctly filters out the special tokens. Note that this problem was present before, but masked by the fact that the special tokens were automatically filtered out of the conversion from ids to string: the recent vllm support for automatic mistral tool parsing allowed to reveal the bug (also see this comment #10333). As a benefit, this should also make the structured output generation by Mistral models more reliable.cc: @patrickvonplaten
Example: code that would break without this PR but passes with it