vllm.entrypoints.pooling.embed.io_processor
¶
Classes:
EmbedIOProcessor
¶
Bases: PoolingIOProcessor
_apply_task_instruction(texts, input_type)
¶
Prepend the task-instruction prefix for input_type.
Returns texts unchanged when no matching prefix is configured.
_batch_render_chat(ctx, all_messages, truncate_prompt_tokens, truncation_side)
¶
Batch-render multiple conversations through the chat template.
_check_cohere_max_tokens(outputs, max_tokens_check)
staticmethod
¶
Raise if any output exceeds max_tokens_check tokens.
Used to enforce truncate=NONE with an explicit max_tokens:
the pipeline runs without truncation and we reject afterwards.
_get_request_factory_cohere_online(ctx)
¶
Convert a CohereEmbedRequest into engine prompts.
If a model has a chat template the task instruction are rendered as a system prompt. Otherwise they are just prepended to the input text.
Images and mixed inputs are always batch-rendered through the chat
template in one render_chat call.
_get_task_instruction_prefix(input_type)
¶
Return the task-instruction prefix for input_type, or None.
_load_st_prompts(model, revision)
staticmethod
¶
Load task_instructions from config_sentence_transformers.json.
_load_task_instructions(hf_config)
staticmethod
¶
Extract task_instructions from the HF model config.
_mixed_input_to_messages(inp, *, task_prefix=None)
staticmethod
¶
Build chat messages from a mixed text+image input.
When task_prefix is given, it is used as the system prompt.
_resolve_cohere_truncation(request)
staticmethod
¶
Return (truncate_prompt_tokens, truncation_side).
_validate_input_type(input_type)
¶
Raise if input_type is not supported by this model.