running updated pre-commit plugins

This commit is contained in:
Dan Saunders
2025-03-20 10:30:18 -04:00
committed by Wing Lian
parent aaa4571826
commit 21bac7ce1a
130 changed files with 420 additions and 291 deletions

View File

@@ -1,4 +1,5 @@
"""pytest tests for axolotl CLI merge_sharded_fsdp_weights command."""
# pylint: disable=duplicate-code
from unittest.mock import patch

View File

@@ -1,6 +1,7 @@
"""
unit tests for generating sweep configurations
"""
from axolotl.cli.main import generate_sweep_configs

View File

@@ -1,4 +1,5 @@
"""pytest tests for axolotl CLI utils."""
# pylint: disable=redefined-outer-name
import json

View File

@@ -1,6 +1,7 @@
"""
shared pytest fixtures
"""
import functools
import importlib
import shutil

View File

@@ -1,6 +1,7 @@
"""
Tests for the chat messages module
"""
import unittest
import pytest

View File

@@ -1,6 +1,7 @@
"""
e2e tests for kd trainer support in Axolotl
"""
from pathlib import Path
import pytest

View File

@@ -1,4 +1,5 @@
"""Tests for GEGLU activation function Triton kernels."""
# pylint: disable=duplicate-code
import torch

View File

@@ -1,4 +1,5 @@
"""Tests for LoRA custom autograd."""
# pylint: disable=invalid-name,redefined-outer-name
import pytest

View File

@@ -1,4 +1,5 @@
"""Tests for quantization utility functions."""
# pylint: disable=invalid-name
import torch

View File

@@ -1,4 +1,5 @@
"""Tests for SwiGLU activation function Triton kernels."""
# pylint: disable=duplicate-code
import torch

View File

@@ -1,6 +1,7 @@
"""
E2E tests for multigpu eval
"""
import logging
import os
from pathlib import Path

View File

@@ -1,6 +1,7 @@
"""
GRPO test suite
"""
import random
from pathlib import Path

View File

@@ -1,4 +1,5 @@
"""Integration tests for LoRA activation and attention kernels."""
# pylint: disable=redefined-outer-name
import pytest

View File

@@ -1,6 +1,7 @@
"""
test cases to make sure the plugin args are loaded from the config file
"""
from pathlib import Path
import yaml

View File

@@ -1,4 +1,5 @@
"""Test module for checking whether the integration of Unsloth with Hugging Face Transformers is working as expected."""
import unittest
import pytest

View File

@@ -1,6 +1,7 @@
"""
e2e tests for unsloth qlora
"""
import logging
import os

View File

@@ -1,6 +1,7 @@
"""
test module to import various submodules that have historically broken due to dependency issues
"""
import unittest

View File

@@ -1,6 +1,7 @@
"""
helper utils for tests
"""
import os
import shutil
import tempfile

View File

@@ -1,6 +1,7 @@
"""
config validation tests for swiglu args
"""
# pylint: disable=duplicate-code
import logging
from typing import Optional

View File

@@ -1,6 +1,7 @@
"""
Unit tests for the monkeypatch utils
"""
import unittest
import torch

View File

@@ -1,6 +1,7 @@
"""
tests for chat_template prompt strategy
"""
# pylint: disable=duplicate-code
import logging
import unittest

View File

@@ -1,6 +1,7 @@
"""
Test module for alpaca integration w chatml
"""
import pytest
from datasets import Dataset
from tokenizers import AddedToken

View File

@@ -1,6 +1,7 @@
"""
Tests for utils in axolotl.utils.chat_templates
"""
import unittest
import pytest

View File

@@ -920,9 +920,11 @@ class TestChatTemplateConfigurations:
)
variables = prompter.get_chat_template_msg_variables(
actual_jinja_template
if actual_jinja_template
else actual_tokenizer.get_chat_template(),
(
actual_jinja_template
if actual_jinja_template
else actual_tokenizer.get_chat_template()
),
"messages",
)

View File

@@ -1,6 +1,7 @@
"""
Tests for loading DPO preference datasets with chatml formatting
"""
import unittest
import pytest

View File

@@ -1,6 +1,7 @@
"""
tests for jinja_template_analyzer
"""
import logging
import pytest

View File

@@ -1,6 +1,7 @@
"""
Test module for raw i/o data for prompts
"""
import pytest
from datasets import Dataset
from tokenizers import AddedToken

View File

@@ -1,6 +1,7 @@
"""
test module for the axolotl.utils.data module
"""
import unittest
from transformers import LlamaTokenizer

View File

@@ -1,6 +1,5 @@
"""Module for testing DictDefault class"""
import unittest
import pytest

View File

@@ -3,6 +3,7 @@ Test suite for functions in the axolotl.utils.data.utils module, focusing on the
Additionally, this test suite includes tests for functions that indirectly call deduplicate_and_log_datasets during the execution of the preprocess command.
"""
import hashlib
import unittest
from unittest.mock import patch
@@ -386,11 +387,11 @@ class TestWrongCollisions(unittest.TestCase):
@patch(
"axolotl.utils.data.utils.sha256",
side_effect=lambda x: hashlib.sha256(
"forced_collision_hash".encode("utf-8")
).hexdigest()
if "sample 5" in x
else hashlib.sha256(x.encode("utf-8")).hexdigest(),
side_effect=lambda x: (
hashlib.sha256("forced_collision_hash".encode("utf-8")).hexdigest()
if "sample 5" in x
else hashlib.sha256(x.encode("utf-8")).hexdigest()
),
)
def test_deduplication_wrong_collision_train_eval(self, _mock_sha256):
dedup_train, dedup_eval, _ = deduplicate_and_log_datasets(

View File

@@ -1,6 +1,7 @@
"""
Unit tests for the monkey patch for expand mask to handle packed sequences
"""
import unittest
import torch

View File

@@ -1,6 +1,7 @@
"""
tests for loading loras
"""
from axolotl.utils.config import normalize_config, validate_config
from axolotl.utils.dict import DictDefault
from axolotl.utils.models import load_model, load_tokenizer

View File

@@ -1,6 +1,7 @@
"""
Test classes for checking functionality of the cfg normalization
"""
import unittest
from unittest.mock import patch

View File

@@ -1,4 +1,5 @@
"""Module for testing streaming dataset sequence packing"""
import pytest
from datasets import concatenate_datasets, load_dataset
from torch.utils.data import DataLoader, RandomSampler

View File

@@ -1,4 +1,5 @@
"""Module for testing streaming dataset sequence packing"""
import functools
import unittest

View File

@@ -1,4 +1,5 @@
"""unit tests for perplexity eval callback"""
# pylint: disable=redefined-outer-name
from pytest import fixture

View File

@@ -1,6 +1,7 @@
"""
test module for the axolotl.utis.data module
"""
import unittest
import torch