vllm.entrypoints.pooling.score.utils ¶
ScoreMultiModalParam ¶
Bases: TypedDict
A specialized parameter type for scoring multimodal content
The reasons why don't reuse CustomChatCompletionMessageParam directly: 1. Score tasks don't need the 'role' field (user/assistant/system) that's required in chat completions 2. Including chat-specific fields would confuse users about their purpose in scoring 3. This is a more focused interface that only exposes what's needed for scoring
Source code in vllm/entrypoints/pooling/score/utils.py
compress_token_type_ids ¶
Return position of the first 1 or the length of the list if not found.
Source code in vllm/entrypoints/pooling/score/utils.py
compute_maxsim_score ¶
Compute ColBERT MaxSim score.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
q_emb | Tensor | Query token embeddings [query_len, dim] | required |
d_emb | Tensor | Document token embeddings [doc_len, dim] | required |
Returns:
| Type | Description |
|---|---|
Tensor | MaxSim score (sum over query tokens of max similarity to any doc token) |
Source code in vllm/entrypoints/pooling/score/utils.py
post_process_tokens ¶
post_process_tokens(
model_config: ModelConfig, prompt: TokensPrompt
) -> None
Perform architecture-specific manipulations on the input tokens.
Note
This is an in-place operation.