nemo_automodel.components.models.gs1.reader
nemo_automodel.components.models.gs1.reader
GS1 decision reads: the checkpoint’s own compiler, one question per read, the native decision head.
Module Contents
Classes
Data
API
Compiler metadata consumed by GS1Model.forward and its readout.
Compiled shared state and native decision branches.
Public compiler interface exposed by GS1 checkpoints.
Native checkpoint methods needed to build the reader.
Bases: DecisionReader[GS1Read]
Reads questions through a GS1 checkpoint’s own request schema, compiler and decision head.
Compile one question with the record’s state (see DecisionReader.encode).
Returns None for requests the checkpoint’s schema or compiler rejects (including reads longer than
data.max_tokens; the compiler never truncates), for branches that need visual inputs (this reader passes
token IDs only) and for questions with fewer than two candidates.
Raises:
ValueError: Ifshuffle_seedis set: the compiler fixes the candidate order.
Stage fields of a GS1 stage.
Candidate logits of one unpadded single-branch forward, fp32 tensor of shape [candidates].
Bases: DecisionRead
One compiled question: the shared state followed by the question’s branch, unpadded.
The compiler’s branch of the question; labels is its candidates.
State tokens followed by the branch suffix.
Number of state tokens at the start of input_ids.
Bases: DecisionReaderConfig[GS1Read]
Read GS1 checkpoints (reader: {_target_: ...GS1ReaderConfig}); full fine-tuning only.
Build the checkpoint’s compiler and load its request schema from the same code revision.
Check the checkpoint code’s dependency and patch Transformers before the checkpoint code loads.