vllm.model_executor.models.nemotron_parse
¶
Classes:
-
BartDecoderLayer– -
BartScaledWordEmbedding–This module overrides VocabParallelEmbedding's
-
MBartDecoderNoPos–Transformer decoder consisting of config.decoder_layers layers.
-
NemotronParseForConditionalGeneration– -
NemotronParsePixelInputs–Dimensions:
-
RadioWithNeck–Vision encoder using RADIO model with custom neck.
BartDecoderLayer
¶
Bases: Module
Methods:
-
forward–Args:
Attributes:
-
self_attn_layer_norm–afeldman-nm: personally I would call this "cross-attention",
self_attn_layer_norm = nn.LayerNorm(self.embed_dim)
instance-attribute
¶
afeldman-nm: personally I would call this "cross-attention", however I left the name as "encoder_attn" to maintain consistency with the name of the pretrained weights.
forward(decoder_hidden_states, encoder_hidden_states=None)
¶
BartScaledWordEmbedding
¶
Bases: VocabParallelEmbedding
This module overrides VocabParallelEmbedding's forward by multiplying with embeddings scale.
MBartDecoderNoPos
¶
NemotronParseForConditionalGeneration
¶
Bases: Module, SupportsMultiModal
Methods:
-
forward–Args:
forward(input_ids, positions, encoder_outputs=None, **kwargs)
¶
Parameters:
-
(input_ids¶Tensor | None) –torch.Tensor of decoder input token ids.
-
(positions¶Tensor) –torch.Tensor of decoder position indices.
-
(encoder_outputs¶list[Tensor] | None, default:None) –List of encoder output tensors (vision embeddings). During profiling, this may be None or empty.
Returns:
-
Tensor–Output torch.Tensor
NemotronParsePixelInputs
¶
_build_uint8_canvas(image_processor, images)
¶
Reproduce the image processor's pipeline up to, but excluding, its
ToTensor rescale, yielding the padded uint8 canvas as (N, 3, H, W).
Raises AttributeError/TypeError if the checkpoint's remote code does
not expose that pipeline.
_to_pil_image(image)
¶
Convert a uint8 array/tensor image item to PIL, since the checkpoint's
image processor calls .convert("RGB") on every input.