Rank 0-only logging (#2608)

Co-authored-by: Wing Lian <wing@axolotl.ai>
This commit is contained in:
salman
2025-05-28 14:57:30 +01:00
committed by GitHub
parent 5fca214108
commit 65c5481120
135 changed files with 454 additions and 378 deletions

View File

@@ -3,14 +3,13 @@ tests for chat_template prompt strategy
"""
# pylint: disable=duplicate-code
import logging
import unittest
from axolotl.prompt_strategies.messages.chat import load
from axolotl.utils.dict import DictDefault
from axolotl.utils.logging import get_logger
logging.basicConfig(level=logging.DEBUG)
LOG = logging.getLogger("axolotl")
LOG = get_logger(__name__, log_level="DEBUG")
class TestMessagesChatLlama3:

View File

@@ -2,7 +2,6 @@
tests for chat_template prompt strategy
"""
import logging
import unittest
from axolotl.prompt_strategies.chat_template import (
@@ -13,9 +12,9 @@ from axolotl.prompt_strategies.chat_template import (
from axolotl.prompters import IGNORE_TOKEN_ID
from axolotl.utils.chat_templates import get_chat_template
from axolotl.utils.dict import DictDefault
from axolotl.utils.logging import get_logger
logging.basicConfig(level=logging.DEBUG)
LOG = logging.getLogger("axolotl")
LOG = get_logger(__name__)
class TestAssistantChatTemplateLlama3:

View File

@@ -4,7 +4,6 @@ tests for chat_template prompt strategy
# pylint: disable=too-many-lines
import logging
from copy import deepcopy
import pytest
@@ -18,11 +17,11 @@ from axolotl.prompt_strategies.chat_template import (
)
from axolotl.prompters import IGNORE_TOKEN_ID
from axolotl.utils.chat_templates import get_chat_template
from axolotl.utils.logging import get_logger
from tests.hf_offline_utils import enable_hf_offline
logging.basicConfig(level=logging.DEBUG)
LOG = logging.getLogger("axolotl")
LOG = get_logger(__name__)
PARAMETRIZE_KEYS = "tokenizer, chat_template, chat_template_jinja, eos_token"
PARAMETRIZE_PARAMS = [

View File

@@ -2,8 +2,6 @@
Tests for splitting reasoning/thinking from content into separate field
"""
import logging
import pytest
from datasets import Dataset
from transformers import AutoTokenizer
@@ -12,11 +10,11 @@ from axolotl.prompt_strategies.chat_template import (
load,
)
from axolotl.utils.dict import DictDefault
from axolotl.utils.logging import get_logger
from tests.hf_offline_utils import enable_hf_offline
logging.basicConfig(level=logging.DEBUG)
LOG = logging.getLogger("axolotl")
LOG = get_logger(__name__)
@pytest.fixture(name="messages_w_reasoning")

View File

@@ -2,14 +2,12 @@
tests for jinja_template_analyzer
"""
import logging
import pytest
from axolotl.prompt_strategies.jinja_template_analyzer import JinjaTemplateAnalyzer
from axolotl.utils.logging import get_logger
logging.basicConfig(level=logging.DEBUG)
LOG = logging.getLogger("axolotl")
LOG = get_logger(__name__, log_level="DEBUG")
class TestJinjaTemplateAnalyzer: