nemo_automodel.components.models.nemotron_decision.records
nemo_automodel.components.models.nemotron_decision.records
SystemOne records for Nemotron Decision post-training: one-question encoding and one-decision JSONL conversion.
The recipe reads SystemOne records ({"id", "state", "questions", "answers"} plus optional rewards,
soft_labels and meta) and reads every question of a record through its own serving prompt. Simple
one-decision-per-line JSONL (state, question, type, options, label, optional soft_labels and
group) converts to single-question records, with group kept in meta for group-disjoint splits.
Module Contents
Functions
Data
API
Convert one simple decision line into a single-question SystemOne record.
Parameters:
{"state", "question", "label"} plus optional id, type (default choice), options,
soft_labels and group.
Line number, used for the record ID when the line has none.
Returns: dict[str, Any]
A record whose only question is "decision". Soft labels are normalized over all options, and group
Raises:
ValueError: If a field is missing or the label/options are inconsistent.
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).
True for records with images or videos (top-level, or state.image): never read as text decisions.
Deterministic group-disjoint split: hash of seed|meta.group (or the state) below fraction.
Normalize a gold/soft label key (noul labels are lower-case true/false).
Read one JSON value per \n-terminated line (not str.splitlines: U+2028 is legal inside JSON strings).
Write rows as UTF-8 JSONL, creating parent directories.