smolvlm
smolvlm
¶
SmolVLM/Idefics3 component for VLA decoders.
SmolVLM
¶
SmolVLM(input_keys, pretrained, frozen, model_name=value, attention_type=value, model_dtype=None, max_text_length=None, lora_config=None)
Bases: HuggingFaceGenerativeVLM
SmolVLM/Idefics3 component with native multi-image support.
Camera images are stacked along the num_images dimension and processed
through SigLIP + connector in a single call, then concatenated with
language embeddings before the SmolLM pass.
Initialize the SmolVLM component.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_keys
|
str | list[str]
|
Input keys for cameras and tokenized text. |
required |
pretrained
|
bool
|
Whether to load pretrained HuggingFace weights. |
required |
frozen
|
bool
|
Whether to freeze all model weights. |
required |
model_name
|
str
|
HuggingFace model identifier for SmolVLM. |
value
|
attention_type
|
str
|
Attention implementation (e.g. SDPA, eager). |
value
|
model_dtype
|
str | None
|
Precision string from experiment config (e.g. |
None
|
max_text_length
|
int | None
|
Maximum text sequence length. Defaults to model's max_position_embeddings if None. |
None
|
lora_config
|
LoRAAdaptation | None
|
Optional LoRA adapter configuration. |
None
|
Source code in src/versatil/models/decoding/generative_language_models/vision_language/smolvlm.py
get_explainability_targets
¶
Return the connector output used by SmolVLA as visual context.
SmolVLM stacks cameras before image encoding, and HuggingFace flattens
the stack to B * num_cameras while producing one token sequence per
camera. The explainability package splits this stacked batch back into
camera-specific heatmaps through is_stacked_camera_batch.
Returns:
| Type | Description |
|---|---|
list[VisionExplanationTarget]
|
One token-sequence target over SmolVLM image tokens. |