[Bugfix] llm.chat bos token duplicate#15695
[Bugfix] llm.chat bos token duplicate#15695nike00811 wants to merge 4 commits intovllm-project:mainfrom
Conversation
Signed-off-by: nike00811 <nike00811@gmail.com>
|
👋 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 🚀 |
|
Thanks @nike00811, this will be addressed by #16081. |
When using
llm.chat, the conversation is first converted into a string and then passed toself.generatefor completion generation. This causes apply_chat_template to prepend a bos token at the beginning of prompt_data. Subsequently, converting prompt_data into prompt_token_ids adds another bos token, resulting in two consecutive bos tokens at the start of the final prompt.I changed the default value of tokenize and added a new parameter to
llm.chat, allowing users to decide whether to enable tokenization.Before fix: (
tokenize = False)After fix: (
tokenize = True)