Skip to main content
Version: Next

基本模型接口

*在线运行 vLLM 入门教程:零基础分步指南

模块内容

*class***vllm.modelexecutor.models.interfaces_base.**VllmModel**(*vllm_config: VllmConfig***,***prefix:**str _=* *''***)**

[source]

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

*class***vllm.modelexecutor.models.interfaces_base.**VllmModelForTextGeneration**(*vllm_config: VllmConfig***,***prefix:**str _=* *''***)**

[source]

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

compute_logits**(*hidden_states: T***,*sampling_metadata: SamplingMetadata*)**→ T |**None

[source]

如果 TP rank > 0,则返回 None

sample**(*logits: T***,*sampling_metadata: SamplingMetadata*)**→ SamplerOutput**

[source]

仅在 TP rank 0 上调用。

*class***vllm.modelexecutor.models.interfaces_base.**VllmModelForPooling**(*vllm_config: VllmConfig***,***prefix:**str _=* *''***)**

[source]

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

pooler**(*hidden_states: T***,*pooling_metadata: PoolingMetadata*)**→ PoolerOutput**

[source]

仅在 TP rank 0 上调用。