[Bugfix] Reject removed pooling parameters (#48984)

Signed-off-by: Taneem Ibrahim <taneem.ibrahim@gmail.com>
This commit is contained in:
Taneem Ibrahim
2026-07-19 05:18:03 -07:00
committed by GitHub
parent ac5f38a0f7
commit e6d1310b2a
9 changed files with 108 additions and 17 deletions
+15
View File
@@ -2,6 +2,8 @@
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
from typing import Literal, get_args
from vllm.exceptions import VLLMValidationError
GenerationTask = Literal["generate", "transcription", "realtime"]
GENERATION_TASKS: tuple[GenerationTask, ...] = get_args(GenerationTask)
@@ -15,6 +17,19 @@ PoolingTask = Literal[
]
POOLING_TASKS: tuple[PoolingTask, ...] = get_args(PoolingTask)
_REMOVED_POOLING_TASK_MESSAGES = {
"score": "`score` task was removed; use `classify` instead.",
"encode": (
"`encode` task was removed; use `token_embed` or `token_classify` instead."
),
}
def check_removed_pooling_task(task: object) -> None:
if isinstance(task, str) and (message := _REMOVED_POOLING_TASK_MESSAGES.get(task)):
raise VLLMValidationError(message, parameter="task")
ScoreType = Literal["bi-encoder", "cross-encoder", "late-interaction"]
SCORE_TYPE_MAP: dict[PoolingTask, ScoreType] = {
"embed": "bi-encoder",