[BugFix][Frontend] Use LoRA tokenizer in OpenAI APIs#6227
[BugFix][Frontend] Use LoRA tokenizer in OpenAI APIs#6227DarkLight1337 merged 12 commits intovllm-project:mainfrom
Conversation
Currently the LoRA tokenizers aren't used in the OpenAI APIs, meaning the behaviour won't be correct if adapters are used that have custom added tokens. This PR includes changes to address that. It mostly replaces vllm-project#3512. More work is needed to address remaining inconsistencies in tokenization behaviour between the OpenAI front-end and standalone LLMEngine/AsyncLLMEngine use, including: - Standalone cases don't honor truncation and add_special_tokens request parameters - OpenAI API cases don't make use of TokenizerGroups for possible parallelization of tokenization As well as some other inefficiencies. But these are to be addressed in follow-on PRs.
|
@dtrifiro FYI |
DarkLight1337
left a comment
There was a problem hiding this comment.
Left some comments!
If possible, try to add a test case to verify whether the OpenAI-compatible server can apply the correct chat template.
Thanks @DarkLight1337, yes test is forthcoming. |
…okenizer-take2 # Conflicts: # vllm/entrypoints/openai/serving_chat.py # vllm/entrypoints/openai/serving_completion.py # vllm/entrypoints/openai/serving_engine.py
|
We can merge after the test case is added. |
…okenizer-take2 # Conflicts: # tests/async_engine/test_chat_template.py # tests/entrypoints/openai/test_completion.py # vllm/entrypoints/openai/serving_chat.py # vllm/entrypoints/openai/serving_completion.py
…okenizer-take2 # Conflicts: # tests/entrypoints/openai/test_chat.py # tests/entrypoints/openai/test_completion.py # tests/entrypoints/openai/test_tokenization.py
|
@DarkLight1337 tests now added! and there were a lot of merge conflicts to resolve 😅 |
|
The error occurs because the |
|
Thanks @DarkLight1337! I pushed a fix before I read your comment, hopefully this should be ok too. |
Co-authored-by: Cyrus Leung <cyrus.tl.leung@gmail.com>
Co-authored-by: Cyrus Leung <cyrus.tl.leung@gmail.com>
Co-authored-by: Cyrus Leung <cyrus.tl.leung@gmail.com> Signed-off-by: Alvant <alvasian@yandex.ru>
Co-authored-by: Cyrus Leung <cyrus.tl.leung@gmail.com> Signed-off-by: LeiWang1999 <leiwang1999@outlook.com>
Currently the LoRA tokenizers aren't used in the OpenAI APIs, meaning the behaviour won't be correct if adapters are used that have custom added tokens. This PR includes changes to address that. It mostly replaces #3512.
More work is needed to address remaining inconsistencies in tokenization behaviour between the OpenAI front-end and standalone
LLMEngine/AsyncLLMEngineuse, including:TokenizerGroups for possible parallelization of tokenizationas well as some other inefficiencies.
But these are to be addressed in follow-on PRs.