fix(truss): make the passing in the chat template more robust BT-15187 #1881
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🚀 What
If
chat_template.jinjaexists at the top level (which it usually should), pass it in explicitly. If it does not exist there, it should be defined insidetokenizer_config.json. vLLM does not implicitly find a Jinja template if it is not passed in. Due to a change in Transformers, thechat_templatekey is no longer included insidetokenizer_config.json.PR where HF removed the
chat_templatefield in the tokenizer💻 How
🔬 Testing
Ran the code to ensure the model starts correctly and I can chat it, With
chat_template.jinjaat the top level versus defined insidetokenizer_config.json- both cases of the if statement. Actually talked to the model with the chat endpoint, not just waiting for it to come up.