transformer_lens.model_bridge.supported_architectures.gemma3n module

Gemma 3n text-only architecture adapter.

Bridges the text path of the full tri-modal Gemma3nForConditionalGeneration (model.language_model + lm_head); the vision/audio towers stay referenced but unbridged (see the vision+audio follow-up). The decoder layers run on a stacked AltUp 4-stream residual, so blocks use AltUpBlockBridge rather than BlockBridge. All math is deferred to HF; submodules are decomposed only for hooks (parity-safe delegation).

class transformer_lens.model_bridge.supported_architectures.gemma3n.Gemma3nArchitectureAdapter(cfg: Any)

Bases: ArchitectureAdapter

Text-only adapter for Gemma 3n (Gemma3nForConditionalGeneration).

applicable_phases: list[int] = [1, 2, 4]
component_mapping: ComponentMapping | None
required_libraries: list[str] = ['timm']
required_libraries_group: str = 'multimodal'
setup_component_testing(hf_model: Any, bridge_model: Any = None) None

Force eager attention so bridge and HF match (sliding/full layer mix).

uses_split_attention: bool
weight_processing_conversions: dict