Skip to content

Conversation

@aghilann
Copy link
Contributor

@aghilann aghilann commented Aug 21, 2025

🚀 What

If chat_template.jinja exists at the top level (which it usually should), pass it in explicitly. If it does not exist there, it should be defined inside tokenizer_config.json. vLLM does not implicitly find a Jinja template if it is not passed in. Due to a change in Transformers, the chat_template key is no longer included inside tokenizer_config.json.

PR where HF removed the chat_template field in the tokenizer

💻 How

🔬 Testing

Ran the code to ensure the model starts correctly and I can chat it, With chat_template.jinja at the top level versus defined inside tokenizer_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.

@aghilann aghilann changed the title fix(truss): make the passing in the chat template more robust fix(truss): make the passing in the chat template more robust BT-15187 Aug 21, 2025
@linear
Copy link

linear bot commented Aug 21, 2025

Copy link
Contributor

@rcano-baseten rcano-baseten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we need to extend this at all in the future, we should probably send information back from the server about the checkpoint

setup_environment_variables_and_secrets,
)

# NB(aghilan): Transformers was recently changed to save a chat_template.jinja file instead of inside the tokenizer_config.json file.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what version? might be helpful to know when it's safe to remove this logic/change this logic?

@aghilann aghilann enabled auto-merge (squash) August 21, 2025 23:20
@aghilann aghilann merged commit eecf341 into main Aug 21, 2025
18 checks passed
@aghilann aghilann deleted the chat-template-fix branch August 21, 2025 23:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants