import sys from pathlib import Path import pytest ROOT = Path(__file__).resolve().parent sys.path.insert(0, str(ROOT)) from moss4gb.paths import default_model_dir # noqa: E402 # Resolved, not relative: a versioned snapshot shares the weights instead of # duplicating them, and the suite should still find them there. MODEL_DIR = default_model_dir() @pytest.fixture(scope="session") def model_dir() -> Path: if not (MODEL_DIR / "transformer" / "config.json").is_file(): pytest.skip("model files not downloaded") return MODEL_DIR @pytest.fixture(scope="session") def has_dit(model_dir) -> Path: shards = sorted((model_dir / "transformer").glob("diffusion_pytorch_model-*.safetensors")) if not shards: pytest.skip("DiT weights not downloaded") return model_dir