vllm.inputs.registry
DummyData ¶
Bases: NamedTuple
Dummy data used for profiling.
Note: This is only used in V0.
Source code in vllm/inputs/registry.py
multi_modal_data class-attribute
instance-attribute
¶
multi_modal_data: Optional[MultiModalDataDict] = None
multi_modal_placeholders class-attribute
instance-attribute
¶
multi_modal_placeholders: Optional[
MultiModalPlaceholderDict
] = None
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
.
Source code in vllm/inputs/registry.py
InputRegistry ¶
Note: This is only used in V0.
Source code in vllm/inputs/registry.py
dummy_data_for_profiling ¶
dummy_data_for_profiling(
model_config: ModelConfig,
seq_len: int,
mm_registry: MultiModalRegistry,
is_encoder_data: bool = False,
) -> DummyData
Create dummy data for profiling the memory usage of a model.
The model is identified by model_config
.