vllm.model_executor.models.interfaces_base
VllmModel
¶
The interface required for all models in vLLM.
Source code in vllm/model_executor/models/interfaces_base.py
__init__
¶
__init__(vllm_config: VllmConfig, prefix: str = '') -> None
VllmModelForPooling
¶
Bases: VllmModel[T]
, Protocol[T]
The interface required for all pooling models in vLLM.
Source code in vllm/model_executor/models/interfaces_base.py
pooler
¶
pooler(
hidden_states: T, pooling_metadata: PoolingMetadata
) -> PoolerOutput
VllmModelForTextGeneration
¶
_check_vllm_model_forward
¶
Source code in vllm/model_executor/models/interfaces_base.py
_check_vllm_model_init
¶
is_pooling_model
¶
is_pooling_model(
model: type[object],
) -> TypeIs[type[VllmModelForPooling]]
is_pooling_model(
model: object,
) -> TypeIs[VllmModelForPooling]
is_pooling_model(
model: Union[type[object], object],
) -> Union[
TypeIs[type[VllmModelForPooling]],
TypeIs[VllmModelForPooling],
]
Source code in vllm/model_executor/models/interfaces_base.py
is_text_generation_model
¶
is_text_generation_model(
model: type[object],
) -> TypeIs[type[VllmModelForTextGeneration]]
is_text_generation_model(
model: object,
) -> TypeIs[VllmModelForTextGeneration]
is_text_generation_model(
model: Union[type[object], object],
) -> Union[
TypeIs[type[VllmModelForTextGeneration]],
TypeIs[VllmModelForTextGeneration],
]