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
Source code in vllm/model_executor/models/interfaces_base.py
embed_input_ids ¶
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
attn_type class-attribute ¶
attn_type: AttnTypeStr = 'decoder'
Indicates the vllm.config.model.ModelConfig.attn_type to use by default.
You can use the vllm.model_executor.models.interfaces_base.attn_type decorator to conveniently set this field.
default_seq_pooling_type class-attribute ¶
default_seq_pooling_type: SequencePoolingType = 'LAST'
Indicates the vllm.config.pooler.PoolerConfig.seq_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.
default_tok_pooling_type class-attribute ¶
default_tok_pooling_type: TokenPoolingType = 'ALL'
Indicates the vllm.config.pooler.PoolerConfig.tok_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_embed_input_ids ¶
Source code in vllm/model_executor/models/interfaces_base.py
_check_vllm_model_forward ¶
Source code in vllm/model_executor/models/interfaces_base.py
_check_vllm_model_init ¶
default_pooling_type ¶
default_pooling_type(
*,
seq_pooling_type: SequencePoolingType = "LAST",
tok_pooling_type: TokenPoolingType = "ALL",
)
Decorator to set VllmModelForPooling.default_*_pooling_type.
Source code in vllm/model_executor/models/interfaces_base.py
get_attn_type ¶
get_attn_type(model: type[object] | object) -> AttnTypeStr
get_default_seq_pooling_type ¶
get_default_seq_pooling_type(
model: type[object] | object,
) -> SequencePoolingType
get_default_tok_pooling_type ¶
get_default_tok_pooling_type(
model: type[object] | object,
) -> TokenPoolingType
is_pooling_model ¶
is_pooling_model(
model: type[object],
) -> TypeIs[type[VllmModelForPooling]]
is_pooling_model(
model: object,
) -> TypeIs[VllmModelForPooling]
is_pooling_model(
model: type[object] | object,
) -> (
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: type[object] | object,
) -> (
TypeIs[type[VllmModelForTextGeneration]]
| TypeIs[VllmModelForTextGeneration]
)