nemo_automodel.components.models.d1.encoder
nemo_automodel.components.models.d1.encoder
Omni’s bidirectional LFM2 composition with media-prefix isolation.
Module Contents
Classes
API
Bases: Module
Checkpoint-compatible bidirectional encoder for text and media embeddings.
Perception modules supply prefixes. Text positions see the prefix and text; media positions see only media. There is no autoregressive cache.
Encode combined media and text embeddings.
Parameters:
Tensor of shape [batch, sequence, hidden].
Boolean Tensor of shape [batch, sequence], including media positions.
Long Tensor of shape [batch], zero for text-only rows.
Returns: torch.Tensor
Normalized Tensor of shape [batch, sequence, hidden].
Bases: Module
Compose standard LFM2 attention/MLP with Omni’s centred convolution.
Run a residual mixer followed by the gated feed-forward block.
Parameters:
Tensor of shape [batch, sequence, hidden].
Pair of cosine and sine Tensors, each of shape [batch, sequence, head_dim].
Additive Tensor of shape [batch, 1, sequence, sequence].
Boolean Tensor of shape [batch, sequence].
Long Tensor of shape [batch] of prefix lengths.
Returns: torch.Tensor
Tensor of shape [batch, sequence, hidden].
Bases: Module
Centred gated convolution; media positions cannot read subsequent text.
Mix neighbouring positions without crossing the media/text boundary.
Parameters:
Tensor of shape [batch, sequence, hidden].
Boolean Tensor of shape [batch, sequence] marking real positions.
Long Tensor of shape [batch] giving each row’s media prefix length.
Returns: torch.Tensor
Tensor of shape [batch, sequence, hidden].