Transformers 5 leaves stale chat_template.jinja files
@prranitarora▲ 11 net votes
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.