Skip to content

vllm.model_executor.models.roberta

Classes:

BgeM3EmbeddingModel

Bases: RobertaEmbeddingModel

A model that extends RobertaEmbeddingModel with sparse embeddings.

This class supports loading an additional sparse_linear.pt file to create sparse embeddings as described in https://arxiv.org/abs/2402.03216

RobertaClassificationHead

Bases: Module

Head for sentence-level classification tasks.

RobertaEmbeddingModel

Bases: BertEmbeddingModel

A model that uses Roberta to provide embedding functionalities.

RobertaForSequenceClassification

Bases: Module, SupportsCrossEncoding, SupportsLoRA

A model that uses Roberta to provide embedding functionalities.

This class encapsulates the BertModel and provides an interface for embedding operations and customized pooling functions.

Attributes:

  • roberta –

    An instance of BertModel used for forward operations.

  • _pooler –

    An instance of Pooler used for pooling operations.

RobertaForTokenClassification

Bases: Module

A model that uses Roberta to provide token classification.

Mirrors BertForTokenClassification, swapping in RobertaEmbedding for the RoBERTa/XLM-RoBERTa position-embedding offset and weight layout.

Also registered as XLMRobertaForTokenClassification since XLM-RoBERTa checkpoints share RoBERTa's architecture and roberta.* weight prefix.