[test] support slow skip and device skip in Uts (#9484)

This commit is contained in:
jiaqiw09
2025-11-13 20:08:22 +08:00
committed by GitHub
parent 8173a88a26
commit 0aa4a051af
3 changed files with 113 additions and 12 deletions

View File

@@ -16,7 +16,7 @@ import os
import pytest
from llamafactory.train.test_utils import compare_model, load_infer_model, load_reference_model, patch_valuehead_model
from llamafactory.train.test_utils import compare_model, load_infer_model, load_reference_model
TINY_LLAMA3 = os.getenv("TINY_LLAMA3", "llamafactory/tiny-random-Llama-3")
@@ -30,11 +30,6 @@ INFER_ARGS = {
}
@pytest.fixture
def fix_valuehead_cpu_loading():
patch_valuehead_model()
def test_base():
model = load_infer_model(**INFER_ARGS)
ref_model = load_reference_model(TINY_LLAMA3)

View File

@@ -23,7 +23,6 @@ from llamafactory.train.test_utils import (
load_infer_model,
load_reference_model,
load_train_model,
patch_valuehead_model,
)
@@ -56,11 +55,6 @@ INFER_ARGS = {
}
@pytest.fixture
def fix_valuehead_cpu_loading():
patch_valuehead_model()
def test_lora_train_qv_modules():
model = load_train_model(lora_target="q_proj,v_proj", **TRAIN_ARGS)
linear_modules, _ = check_lora_model(model)