add precommit
This commit is contained in:
1 parent
1bf3424e96
commit
a04e945166
24 files changed
+434
-377
No files matched your search
+18
-14
@@ -2,10 +2,17 @@
|
||||
Shared fixtures and configuration for vLLM-omni tests.
|
||||
"""
|
||||
|
||||
from unittest.mock import Mock
|
||||
|
||||
import pytest
|
||||
import torch
|
||||
from unittest.mock import Mock
|
||||
from vllm_omni.config import OmniStageConfig, DiTConfig, DiTCacheConfig, create_ar_stage_config, create_dit_stage_config
|
||||
|
||||
from vllm_omni.config import (
|
||||
DiTCacheConfig,
|
||||
DiTConfig,
|
||||
create_ar_stage_config,
|
||||
create_dit_stage_config,
|
||||
)
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
@@ -21,7 +28,7 @@ def sample_ar_stage_config():
|
||||
stage_id=0,
|
||||
model_path="test-ar-model",
|
||||
input_modalities=["text"],
|
||||
output_modalities=["text"]
|
||||
output_modalities=["text"],
|
||||
)
|
||||
|
||||
|
||||
@@ -32,15 +39,15 @@ def sample_dit_stage_config():
|
||||
model_type="dit",
|
||||
scheduler_type="ddpm",
|
||||
num_inference_steps=10,
|
||||
guidance_scale=7.5
|
||||
guidance_scale=7.5,
|
||||
)
|
||||
|
||||
|
||||
return create_dit_stage_config(
|
||||
stage_id=1,
|
||||
model_path="test-dit-model",
|
||||
input_modalities=["text"],
|
||||
output_modalities=["image"],
|
||||
dit_config=dit_config
|
||||
dit_config=dit_config,
|
||||
)
|
||||
|
||||
|
||||
@@ -64,19 +71,16 @@ def mock_vllm_config():
|
||||
def mock_dit_cache_config():
|
||||
"""Mock DiT cache configuration."""
|
||||
from vllm_omni.config import DiTCacheTensor
|
||||
|
||||
|
||||
cache_tensors = [
|
||||
DiTCacheTensor(
|
||||
name="test_tensor",
|
||||
shape=[1, 512, 512],
|
||||
dtype="float32",
|
||||
persistent=True
|
||||
name="test_tensor", shape=[1, 512, 512], dtype="float32", persistent=True
|
||||
)
|
||||
]
|
||||
|
||||
|
||||
return DiTCacheConfig(
|
||||
cache_tensors=cache_tensors,
|
||||
max_cache_size=1024 * 1024 * 1024, # 1GB
|
||||
cache_strategy="fifo",
|
||||
enable_optimization=True
|
||||
)
|
||||
enable_optimization=True,
|
||||
)
|
||||
Reference in new issue
Block a user