Skip to content

Commit

Permalink
Warn if we override the chat template in the tokenizer config
Browse files Browse the repository at this point in the history
  • Loading branch information
chiwanpark committed Aug 10, 2024
1 parent 0801f23 commit 2bf1ed9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/axolotl/utils/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,12 @@ def load_tokenizer(cfg):
"You are a helpful assistant.", cfg.default_system_message
)

if tokenizer.chat_template:
LOG.warning(
"The chat template is being overridden by the one in the config. "
"This may cause a mismatch with the existing chat template in the base model. "
"Please verify that this override is intended and compatible."
)
tokenizer.chat_template = chat_template_string
else:
LOG.info(
Expand Down

0 comments on commit 2bf1ed9

Please sign in to comment.