[Model][7/N] Improve all pooling task | Deprecation as_reward_model. Extract hidden states prefer using new multi-vector retrieval API (#26686)

Signed-off-by: wang.yuqi <yuqi.wang@daocloud.io>
This commit is contained in:
wang.yuqi
2025-12-08 16:10:09 +08:00
committed by GitHub
parent bcb6f5947f
commit 9e77ffca3f
8 changed files with 88 additions and 58 deletions

View File

@@ -516,7 +516,11 @@ class ModelConfig:
if task == "classify":
return "classify"
if task == "reward":
return "reward"
logger.warning(
"Pooling models now default support all pooling; "
"you can use it without any settings."
)
return "embed"
if task == "score":
new_task = self._get_default_pooling_task(architectures)
return "classify" if new_task == "classify" else "embed"
@@ -1899,8 +1903,8 @@ _SUFFIX_TO_DEFAULTS: list[tuple[str, tuple[RunnerType, ConvertType]]] = [
("ForImageClassification", ("pooling", "classify")),
("ForVideoClassification", ("pooling", "classify")),
("ClassificationModel", ("pooling", "classify")),
("ForRewardModeling", ("pooling", "reward")),
("RewardModel", ("pooling", "reward")),
("ForRewardModeling", ("pooling", "embed")),
("RewardModel", ("pooling", "embed")),
# Let other `*Model`s take priority
("Model", ("pooling", "embed")),
]