nemo_automodel.components.models.llama_bidirectional.model
nemo_automodel.components.models.llama_bidirectional.model
Llama Bidirectional model for embedding and retrieval tasks.
This module provides a bidirectional variant of Llama that is auto-discovered by the ModelRegistry via the ModelClass export.
To add support for other backbones (e.g., Qwen2, Mistral), create a similar module in a new directory (e.g., qwen2_bidirectional/) with its own ModelClass export.
Module Contents
Classes
Functions
Data
API
Bases: LlamaConfig
Configuration class for LlamaBidirectionalModel.
Extends LlamaConfig with additional parameters for bidirectional attention and pooling configurations.
Bases: LlamaPreTrainedModel
Llama Bidirectional Model with a sequence classification/regression head.
This model adds a classification head on top of the bidirectional Llama model and includes configurable pooling strategies.
Return the temperature applied to score logits by this model.
Bases: LlamaModel
Llama retrieval model with a configurable attention mode.
False preserves legacy bidirectional behavior; true uses the stock Llama causal mask.
Pool hidden states using the specified pooling method.
Register bidirectional Llama types with Hugging Face Auto classes.
Enables AutoConfig, AutoModel, and AutoModelForSequenceClassification
to resolve their corresponding bidirectional config and model classes.