diff --git a/src/axolotl/prompt_strategies/chat_template.py b/src/axolotl/prompt_strategies/chat_template.py index 0271fca24..6d2a048b2 100644 --- a/src/axolotl/prompt_strategies/chat_template.py +++ b/src/axolotl/prompt_strategies/chat_template.py @@ -103,6 +103,7 @@ class ChatTemplatePrompter(Prompter): chat_template_kwargs = { "chat_template": self.chat_template, "add_generation_prompt": add_generation_prompt, + **self.chat_template_kwargs, } if tools: diff --git a/src/axolotl/utils/schemas/config.py b/src/axolotl/utils/schemas/config.py index 4031742cd..da0d3c935 100644 --- a/src/axolotl/utils/schemas/config.py +++ b/src/axolotl/utils/schemas/config.py @@ -778,6 +778,12 @@ class AxolotlInputConfig( "description": "Custom jinja template for chat template. This will be only used if chat_template is set to `jinja` or `null` (in which case chat_template is automatically set to `jinja`). Default is null." }, ) + chat_template_kwargs: dict[str, Any] | None = Field( + default=None, + json_schema_extra={ + "description": "Additional kwargs to pass to the chat template. This is useful for customizing the chat template. For example, you can pass `thinking=False` to add a generation prompt to the chat template." + }, + ) eot_tokens: list[str] | None = Field( default=None, json_schema_extra={