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