nemo_automodel.components.models.deepseek_v4.processing
nemo_automodel.components.models.deepseek_v4.processing
Processor for DeepSeek-V4-Flash-Vision-Exp.
Module Contents
Classes
Functions
Data
DEEPSEEK_V4_LABEL_CHAT_TEMPLATE
API
Bases: ProcessorMixin
Exact prompt and dynamic-resolution image processor for DSV4 Vision.
Return the textual placeholder ID that is expanded before padding.
Tokenize text and expand each image placeholder into pseudo IDs.
Returns a batch whose input_ids, attention_mask, and
vision_token_types use layout [batch, sequence];
pixel_values uses [all_patches, 3, patch_size, patch_size] and
image_grid_hws uses [all_images, 2].
Render ordered content blocks and collect their image values.
Render one standard conversation into the released chat format.
Render or tokenize one conversation or a batch of conversations.
Forward batched decoding to the underlying tokenizer.
Forward decoding to the underlying tokenizer.
Load the tokenizer and vision settings from one checkpoint.
Load a supported local, byte, dictionary, or PIL image as RGB.
Build reference N-layout token types and aligned-image permutation.
Returns: torch.Tensor
types with layout [image_block_tokens] and perm with layout
Return the aligned LLM grid and N-layout token count for one image.
Transform one image into normalized ViT patches.
Returns: torch.Tensor
Patches with layout [n_vit_h * n_vit_w, 3, patch_size, patch_size]
Fit an image to the reference N-layout visual-token budget.
Solve the reference resize approximation for a visual-token budget.