From 2bf1ed9fdfd3e06364d560fa20b8a70a0c6fe268 Mon Sep 17 00:00:00 2001 From: Chiwan Park Date: Sat, 10 Aug 2024 18:17:50 +0900 Subject: [PATCH] Warn if we override the chat template in the tokenizer config --- src/axolotl/utils/models.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/axolotl/utils/models.py b/src/axolotl/utils/models.py index 5ac66260a..2f7ffc8b0 100644 --- a/src/axolotl/utils/models.py +++ b/src/axolotl/utils/models.py @@ -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(