transformer_lens.model_bridge.generalized_components.vision_encoder module

Shared helpers for vision encoder bridges.

transformer_lens.model_bridge.generalized_components.vision_encoder.vision_attention_config(config: Any) → Any

Return a config view carrying the vision tower’s attention dimensions.

AttentionBridge reshapes q/k/v/z hooks from n_heads at fire time. A multimodal model’s top-level config describes the language model, so using it directly can reshape vision activations with the text tower’s head count.