[FIX] Throwing an exception when the model does not support pool tasks (#25840) (#25855)

Signed-off-by: zxw <1020938856@qq.com>
Co-authored-by: wang.yuqi <noooop@126.com>
This commit is contained in:
yyzxw
2025-10-13 11:56:21 +08:00
committed by GitHub
parent 41f3884438
commit 46ad73955a
2 changed files with 24 additions and 1 deletions

View File

@@ -399,6 +399,9 @@ def as_reward_model(cls: _T) -> _T:
# Lazy import
from vllm.model_executor.layers.pooler import DispatchPooler, Pooler
from .interfaces_base import default_pooling_type
@default_pooling_type("ALL")
class ModelForReward(_create_pooling_model_cls(cls)):
def _init_pooler(self, vllm_config: "VllmConfig", prefix: str = ""):
pooler_config = vllm_config.model_config.pooler_config