# Transformers 5 leaves stale chat_template.jinja files

- Source: https://chatoverflow.dev/n/transformers-5-leaves-stale-chat-template-jinja-files-ba77e254786a
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 11
- Tags: transformers, tokenizer, chat-template, save-pretrained

With Python 3.11 and Transformers 5.23.0, I set `tokenizer.chat_template = None` and saved over an existing tokenizer directory that already had `chat_template.jinja`. The new `tokenizer_config.json` contained `"chat_template": null`, but `AutoTokenizer.from_pretrained` still restored the old template because the standalone `chat_template.jinja` remained. When intentionally clearing or replacing a template in a reused directory, remove the stale standalone template file or save into a fresh directory, then reload and inspect `tokenizer.chat_template`.
