nemo_automodel.components.models.nemotron_decision
nemo_automodel.components.models.nemotron_decision
Typed-decision post-training support for Nemotron 3.5 Decision checkpoints.
Submodules
nemo_automodel.components.models.nemotron_decision.exportnemo_automodel.components.models.nemotron_decision.modelnemo_automodel.components.models.nemotron_decision.recordsnemo_automodel.components.models.nemotron_decision.scorernemo_automodel.components.models.nemotron_decision.serving_prompt
Package Contents
Classes
Functions
API
A checkpoint’s decision prompt contract (decision.json and decision_template.jinja).
Option codes per question type, in position order.
Longest read the checkpoint accepts, mask included.
Identity of the contract (template, codes and limit).
The Jinja decision template; it renders decision_content and ends with the mask token.
Load and validate the contract of a local checkpoint directory or Hugging Face repository.
Raises:
ValueError: If a file is missing or the contract is malformed.
Bases: PreTrainedModel
Bidirectional Ministral 3 encoder plus a vocabulary head read at the decision mask token.
Read the sequence bidirectionally.
Parameters:
Token ids [batch, sequence].
Optional padding mask [batch, sequence].
Optional positions [batch, sequence]; defaults to 0..sequence-1.
Optional embeddings instead of input_ids.
Return the encoder’s last hidden state without projecting the
[batch, sequence, vocab] logits.
Passed to the encoder (use_cache is ignored; decision reads keep no cache).
Returns: BaseModelOutput | MaskedLMOutput
BaseModelOutput(last_hidden_state) or MaskedLMOutput(logits).
Token embeddings of the encoder.
The decision readout head.
Replace the encoder’s token embeddings.
Replace the decision readout head.
True for text Ministral 3 decision checkpoints (no vision tower, no quantization).
One tokenized decision prompt (without the trailing mask) and its option readout.
Encode one question of a record as its decision prompt, or None if this model cannot read it.
A question is not readable when the record carries media, the question does not fit the checkpoint’s contract (no
instructions, unsupported fields, or more options than codes), or the prompt plus its mask is longer than
max_tokens. The caller counts these questions.
Parameters:
Tokenizer of the checkpoint.
The checkpoint’s decision contract.
Validated SystemOne record that holds the question.
Key of the question in record["questions"].
The checkpoint’s mask token.
Longest allowed prompt including the mask slot.
Option-shuffle seed (None keeps the checkpoint’s option order).
Render one question with the checkpoint’s decision template, optionally with shuffled, re-coded options.
Parameters:
Tokenizer of the checkpoint.
The checkpoint’s decision contract.
JSON-serializable evidence shared by the question.
Key of the question (used in errors).
{"type", "instructions", "criteria"} of a choice, noul or score question.
The checkpoint’s mask token, which the template must write exactly once, at the end.
When set, permute the options with perm_seed(shuffle_seed) and re-code them by position;
None keeps the checkpoint’s option order.
Returns: PreparedQuestion
The prepared prompt; token ids exclude the trailing mask.
Raises:
ValueError: If the question is malformed, has more options than codes, or the template does not end in exactly one mask token.
Reject checkpoints whose runtime contract this recipe does not implement.
The recipe trains Nemotron 3.5 Decision checkpoints: a text Ministral 3 encoder read with fully bidirectional attention, one question per read, and the decision head at the mask token. Vision and quantized variants need their own input and storage paths and are not run silently as the text model.
Parameters:
Hugging Face config (attribute access) of the checkpoint.
Raises:
ValueError: If the architecture, attention or storage format is unsupported.