refactor: 统一采样路径为 Strategy + batch tensor,删除 apply_sampling_strategies
- TemperatureStrategy / TopKStrategy / TopPStrategy 支持 Union[float, Tensor] - SamplingPipeline.sample() 一条调用完成 apply + softmax + multinomial - 新增 sample() 独立函数作为 scheduler 入口 - scheduler decode 改为 batch tensor 参数传递,支持任意 batch size - 删除 apply_sampling_strategies(被 sample() 取代)
This commit is contained in:
@@ -19,7 +19,7 @@ from astrai.inference.sampling import (
|
||||
TemperatureStrategy,
|
||||
TopKStrategy,
|
||||
TopPStrategy,
|
||||
apply_sampling_strategies,
|
||||
sample,
|
||||
)
|
||||
from astrai.inference.scheduler import (
|
||||
InferenceScheduler,
|
||||
@@ -37,7 +37,7 @@ __all__ = [
|
||||
"Task",
|
||||
"TaskStatus",
|
||||
# Sampling (Strategy pattern)
|
||||
"apply_sampling_strategies",
|
||||
"sample",
|
||||
"BaseSamplingStrategy",
|
||||
"TemperatureStrategy",
|
||||
"TopKStrategy",
|
||||
|
||||
Reference in New Issue
Block a user