vllm.inputs.registry ¶
InputContext dataclass ¶
Contains information about the model which may be used to modify the inputs.
Source code in vllm/inputs/registry.py
get_hf_config ¶
Get the HuggingFace configuration (transformers.PretrainedConfig) of the model, additionally checking its type.
Raises:
| Type | Description |
|---|---|
TypeError | If the configuration is not of the specified type. |
Source code in vllm/inputs/registry.py
get_hf_image_processor_config ¶
get_hf_processor ¶
get_hf_processor(
typ: Union[
type[_P], tuple[type[_P], ...]
] = ProcessorMixin,
/,
**kwargs: object,
) -> _P
Get the HuggingFace processor (transformers.ProcessorMixin) of the model, additionally checking its type.
Raises:
| Type | Description |
|---|---|
TypeError | If the processor is not of the specified type. |
Source code in vllm/inputs/registry.py
get_mm_config ¶
Get the multimodal config of the model.
Raises:
| Type | Description |
|---|---|
RuntimeError | If the model is not a multimodal model. |
Source code in vllm/inputs/registry.py
init_processor ¶
Initialize a HuggingFace-like processor class, merging the keyword arguments with those in the model's configuration.
Source code in vllm/inputs/registry.py
InputProcessingContext dataclass ¶
Bases: InputContext
Source code in vllm/inputs/registry.py
call_hf_processor ¶
call_hf_processor(
hf_processor: ProcessorMixin,
data: Mapping[str, object],
kwargs: Mapping[str, object] = {},
) -> Union[BatchFeature, JSONTree]
Call hf_processor on the prompt data (text, image, audio...) with configurable options kwargs.