Skip to navigation

nemo_automodel.components.models.d1.vl_model

View as Markdown

D1-3B causal image/text backbone with its released tied vocabulary readout.

Module Contents

Classes

NameDescription
Lfm2VlForConditionalGenerationD1-3B’s chain execution, using HF vision and native precision-correct LFM2.

API

class nemo_automodel.components.models.d1.vl_model.Lfm2VlForConditionalGeneration(
config: transformers.Lfm2VlConfig
)

Bases: HFCheckpointingMixin, HFLfm2VlForConditionalGeneration

D1-3B’s chain execution, using HF vision and native precision-correct LFM2.

Questions are independent causal chains. The release’s shared-trunk tree batching is an inference optimization and is not used by this training path. Parameter names and the checkpoint’s input/output tying policy are retained. Ordinary LFM2-VL checkpoints retain the inherited HuggingFace generation, cache, forward-output and image-feature interfaces.

_tied_weights_keys
base_model_prefix
= 'model'
device
device

Device holding the text embedding table.

dtype
dtype

Dtype of the text embedding table.

tie_word_embeddings_support
TieSupport = TieSupport.BOTH
nemo_automodel.components.models.d1.vl_model.Lfm2VlForConditionalGeneration.get_input_embeddings() -> torch.nn.Embedding

Return the released text embedding table.

nemo_automodel.components.models.d1.vl_model.Lfm2VlForConditionalGeneration.get_output_embeddings() -> torch.nn.Linear

Return the vocabulary projection, honoring the checkpoint’s tying policy.

nemo_automodel.components.models.d1.vl_model.Lfm2VlForConditionalGeneration.prepare_text_readout(

Prepare the released answer-alias adapter for text-only adaptation.

Parameters:

examples
list[D1TextExample]

Publisher-encoded questions used to select answer vocabulary rows.

Returns: D1CausalTextReadout

Final-token feature extractor and zero-initialized answer-row adapter.

nemo_automodel.components.models.d1.vl_model.Lfm2VlForConditionalGeneration.set_input_embeddings(
value: torch.nn.Embedding
) -> None

Replace and retie the text embedding table.

nemo_automodel.components.models.d1.vl_model.Lfm2VlForConditionalGeneration.supports_config(
config: transformers.Lfm2VlConfig
) -> bool
classmethod

Select D1 arithmetic only for the publisher’s explicit D1 model mapping.

nemo_automodel.components.models.d1.vl_model.Lfm2VlForConditionalGeneration.tie_weights(
kwargs: typing.Any = {}
) -> None

Honor the checkpoint’s tied or independently initialized vocabulary head.