diff --git a/src/axolotl/prompt_strategies/chat_template.py b/src/axolotl/prompt_strategies/chat_template.py index f91f380d9..38460ebac 100644 --- a/src/axolotl/prompt_strategies/chat_template.py +++ b/src/axolotl/prompt_strategies/chat_template.py @@ -341,10 +341,10 @@ def load(tokenizer, cfg, ds_cfg: Optional[Dict[str, Any]] = None): chat_template = ds_cfg.get("chat_template", "chatml") chat_template_str = chat_templates(chat_template, tokenizer=tokenizer) LOG.info(f"Using chat template:\n---\n{chat_template_str!s}\n---") - + prompter_params = { "tokenizer": tokenizer, - "chat_template": chat_templates(ds_cfg.get("chat_template", "chatml")), + "chat_template": chat_template_str, "message_field_role": ds_cfg.get("message_field_role", "from"), "message_field_content": ds_cfg.get("message_field_content", "value"), "message_field_training": ds_cfg.get("message_field_training", "training"), diff --git a/src/axolotl/utils/config/models/input/v0_4_1/__init__.py b/src/axolotl/utils/config/models/input/v0_4_1/__init__.py index 38975b071..343e65b55 100644 --- a/src/axolotl/utils/config/models/input/v0_4_1/__init__.py +++ b/src/axolotl/utils/config/models/input/v0_4_1/__init__.py @@ -7,9 +7,9 @@ Module for pydantic models for configuration import logging import os from enum import Enum +from importlib.metadata import version from typing import Annotated, Any, Dict, List, Literal, Optional, Tuple, Union -from importlib.metadata import version from pydantic import ( BaseModel, Field, diff --git a/tests/prompt_strategies/test_chat_templates.py b/tests/prompt_strategies/test_chat_templates.py index b5607e00b..97b8792fd 100644 --- a/tests/prompt_strategies/test_chat_templates.py +++ b/tests/prompt_strategies/test_chat_templates.py @@ -720,7 +720,6 @@ class TestChatTemplateConfigurations: LOG.debug(f"Final input_ids: {input_ids}") - class TestAssistantChatTemplateLlama3: """ Test class for assistant style datasets with llama-3 prompts using the chat_template strategy.