基础模型接口#

模块内容#

class vllm.model_executor.models.interfaces_base.VllmModel(vllm_config: VllmConfig, prefix: str = '')[source]#

vLLM 中所有模型所需的接口。

class vllm.model_executor.models.interfaces_base.VllmModelForTextGeneration(vllm_config: VllmConfig, prefix: str = '')[source]#

vLLM 中所有生成模型所需的接口。

compute_logits(hidden_states: T, sampling_metadata: SamplingMetadata) T | None[source]#

如果 TP 秩 > 0,则返回 None

sample(logits: T, sampling_metadata: SamplingMetadata) SamplerOutput[source]#

仅在 TP 秩为 0 时调用。

class vllm.model_executor.models.interfaces_base.VllmModelForPooling(vllm_config: VllmConfig, prefix: str = '')[source]#

vLLM 中所有池化模型所需的接口。

pooler(hidden_states: T, pooling_metadata: PoolingMetadata) PoolerOutput[source]#

仅在 TP 秩为 0 时调用。