Skip to content

Commit 25198aa

Browse files
committed
Throwing an exception when the model does not support pool tasks
Signed-off-by: zxw <1020938856@qq.com>
1 parent 0307428 commit 25198aa

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

vllm/v1/worker/gpu_model_runner.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3375,8 +3375,17 @@ def _dummy_pooler_run(
33753375
hidden_states: torch.Tensor,
33763376
) -> PoolerOutput:
33773377
# Find the task that has the largest output for subsequent steps
3378+
supported_pooling_tasks = self.get_supported_pooling_tasks()
3379+
3380+
if not supported_pooling_tasks:
3381+
raise RuntimeError(
3382+
f"Model {self.model_config.model} does not support "
3383+
"any pooling tasks. see "
3384+
"https://docs.vllm.ai/en/latest/models/pooling_models.html "
3385+
"to learn more.")
3386+
33783387
output_size = dict[PoolingTask, float]()
3379-
for task in self.get_supported_pooling_tasks():
3388+
for task in supported_pooling_tasks:
33803389
# Run a full batch with each task to ensure none of them OOMs
33813390
output = self._dummy_pooler_run_task(hidden_states, task)
33823391
output_size[task] = sum(o.nbytes for o in output)

0 commit comments

Comments
 (0)