nemo_automodel.components.models.inkling2.processing
nemo_automodel.components.models.inkling2.processing
Released Inkling2 image/chat preprocessing for the shared VLM collator.
Module Contents
Classes
Functions
Data
API
Bases: ProcessorMixin
Image/text processor with explicit image-body ownership and assistant masks.
Render image/text conversations through the released control-token grammar.
Parameters:
One conversation or a batch of HF-style role/content records. Images must be PIL objects; text content is a string or text record.
Produce token IDs and patches when true, rendered strings otherwise.
Return token fields plus media tensors when true.
Tensor framework; training supports only ‘pt’.
Include the template’s assistant supervision mask.
HF tokenizer padding, truncation and maximum-length options.
Accepted for the HF interface; this renderer adds no prefix.
Additional HuggingFace tokenizer template options.
Returns: BatchFeature | torch.Tensor | str | list[str]
HF-compatible token output. Token fields are [batch, sequence]; image patches
Load the released tokenizer and verify its image preprocessing contract.
Prepare one unresized image using the released 40-pixel patch policy.
RGBA is composited onto an 8-pixel 204/153 checkerboard. Padding is -1 in pixel space. Normalization uses the release’s FP32 CLIP constants, then casts to BF16 and duplicates each spatial patch along the temporal axis.
Returns: torch.Tensor
BF16 patches [rows*columns, 2, 40, 40, 3] and int64 grid [1, 3].