refactor: 设计模式优化 inference 模块导入结构

- 新建 cache.py:SlotAllocator 对象池 + PrefixCacheManager

- 新建 sampling.py:Temperature/TopK/TopP 可组合策略

- TaskStatus 改用 Enum,GenerationParams 值对象模式

- _STOP 移至 cache.py,解除 engine→scheduler 轻量耦合

- 更新测试导入路径,ruff 格式检查通过
This commit is contained in:
2026-05-08 16:57:57 +08:00
parent c4401512f2
commit 44d7a4e959
7 changed files with 470 additions and 257 deletions
@@ -6,9 +6,9 @@ from unittest.mock import MagicMock, patch
import pytest
from astrai.inference.cache import PrefixCacheManager
from astrai.inference.scheduler import (
InferenceScheduler,
PrefixCacheManager,
)