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_co]
, Protocol[T_co]
The interface required for all pooling models in vLLM.
Source code in vllm/model_executor/models/interfaces_base.py
default_pooling_type class-attribute
¶
default_pooling_type: str = 'LAST'
Indicates the vllm.model_executor.layers.pooler.PoolerConfig.pooling_type to use by default.
You can use the vllm.model_executor.models.interfaces_base.default_pooling_type decorator to conveniently set this field.
VllmModelForTextGeneration ¶
_check_vllm_model_forward ¶
Source code in vllm/model_executor/models/interfaces_base.py
_check_vllm_model_init ¶
default_pooling_type ¶
default_pooling_type(pooling_type: str)
Decorator to set VllmModelForPooling.default_pooling_type
.
Source code in vllm/model_executor/models/interfaces_base.py
get_default_pooling_type ¶
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],
]