Repository navigation
[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>
…tructured output with MistralTokenizer (vllm-project#10363) Signed-off-by: Guillaume Calmettes <gcalmettes@scaleway.com>
This PR improves the support of the vllm
MistralTokenizerwith the guided structured output functionalities.In particular:
lm-format-enforceris 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)MistralTokenizermethods 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.:jsonoutput) 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