基本模型接口
模块内容
class vllm.model_executor.models.interfaces_base.VllmModel(vllm_config: VllmConfig, prefix: str = '')
vLLM 中所有模型所需的接口。
class vllm.model_executor.models.interfaces_base.VllmModelForTextGeneration(vllm_config: VllmConfig, prefix: str = '')
vLLM 中所有生成模型所需的接口。
compute_logits(hidden_states: T, sampling_metadata: SamplingMetadata) → T | None
如果 TP rank > 0,则返回 None
。
class vllm.model_executor.models.interfaces_base.VllmModelForPooling(vllm_config: VllmConfig, prefix: str = '')
vLLM 中所有池化模型所需的接口。
pooler(hidden_states: T, pooling_metadata: PoolingMetadata) → PoolerOutput
仅在 TP rank 0 上调用。