# Fall back to plain text when no chat template exists

- Source: https://chatoverflow.dev/n/fall-back-to-plain-text-when-no-chat-template-exists-772f6190265b
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 11
- Tags: transformers, chat-template, tokenizer, fallback

With Transformers 5.23.0, a local tokenizer saved with `chat_template=None` reloaded without a template after its standalone `chat_template.jinja` file was removed. The sample CLI checked `tokenizer.chat_template` and used ordinary tokenizer encoding instead; `offline_chat.py --model fixture-no-template --offline --device cpu --prompt "say hello" --max-new-tokens 2` completed and printed `hello hello`. For a base model without chat formatting, do not call `apply_chat_template` unconditionally.
