Skip to navigation

nemo_automodel.components.models.nemotron_decision.model

View as MarkdownOpen in Claude

Native NemotronForDecision: a bidirectional Ministral 3 encoder with the decision readout head.

Nemotron 3.5 Decision checkpoints ship architectures: ["NemotronForDecision"] with remote code that needs a newer Transformers than this repository pins. This class loads the same checkpoint natively: the encoder is Ministral3BidirectionalModel (non-causal attention over the whole sequence) and the head keeps the checkpoint’s weight name, diffusion_head (named after the checkpoint it was initialized from), so the safetensors load and export without renaming.

Module Contents

Classes

NameDescription
NemotronForDecisionBidirectional Ministral 3 encoder plus a vocabulary head read at the decision mask token.

Data

ARCHITECTURE

API

class nemo_automodel.components.models.nemotron_decision.model.NemotronForDecision(
config: transformers.models.ministral3.configuration_ministral3.Ministral3Config,
kwargs: typing.Any = {}
)

Bases: PreTrainedModel

Bidirectional Ministral 3 encoder plus a vocabulary head read at the decision mask token.

_no_split_modules
= ['Ministral3DecoderLayer']
base_model_prefix
= 'encoder'
diffusion_head
encoder
= Ministral3BidirectionalModel(config)
tie_word_embeddings_support
TieSupport = TieSupport.UNTIED_ONLY
nemo_automodel.components.models.nemotron_decision.model.NemotronForDecision.forward(
input_ids: torch.LongTensor | None = None,
attention_mask: torch.Tensor | None = None,
position_ids: torch.LongTensor | None = None,
inputs_embeds: torch.FloatTensor | None = None,
output_last_hidden_states_only: bool = False,
kwargs: typing.Any = {}
) -> transformers.modeling_outputs.BaseModelOutput | transformers.modeling_outputs.MaskedLMOutput

Read the sequence bidirectionally.

Parameters:

input_ids
torch.LongTensor | NoneDefaults to None

Token ids [batch, sequence].

attention_mask
torch.Tensor | NoneDefaults to None

Optional padding mask [batch, sequence].

position_ids
torch.LongTensor | NoneDefaults to None

Optional positions [batch, sequence]; defaults to 0..sequence-1.

inputs_embeds
torch.FloatTensor | NoneDefaults to None

Optional embeddings instead of input_ids.

output_last_hidden_states_only
boolDefaults to False

Return the encoder’s last hidden state without projecting the [batch, sequence, vocab] logits.

**kwargs
AnyDefaults to {}

Passed to the encoder (use_cache is ignored; decision reads keep no cache).

Returns: BaseModelOutput | MaskedLMOutput

BaseModelOutput(last_hidden_state) or MaskedLMOutput(logits).

nemo_automodel.components.models.nemotron_decision.model.NemotronForDecision.get_input_embeddings() -> torch.nn.Embedding

Token embeddings of the encoder.

nemo_automodel.components.models.nemotron_decision.model.NemotronForDecision.get_output_embeddings() -> torch.nn.Linear

The decision readout head.

nemo_automodel.components.models.nemotron_decision.model.NemotronForDecision.set_input_embeddings(
value: torch.nn.Embedding
) -> None

Replace the encoder’s token embeddings.

nemo_automodel.components.models.nemotron_decision.model.NemotronForDecision.set_output_embeddings(
value: torch.nn.Linear
) -> None

Replace the decision readout head.

nemo_automodel.components.models.nemotron_decision.model.NemotronForDecision.supports_config(
config: typing.Any
) -> bool
classmethod

True for text Ministral 3 decision checkpoints (no vision tower, no quantization).

nemo_automodel.components.models.nemotron_decision.model.ARCHITECTURE = 'NemotronForDecision'