Skip to main content

Module llava

Module llava 

Source
Expand description

LLaVA Model V2 - Clean implementation using solid abstractions

This implements the LLaVA (Large Language and Vision Assistant) architecture including:

  • LLaVA-1.5-7B, LLaVA-1.5-13B, LLaVA-1.6-7B, LLaVA-1.6-13B, LLaVA-1.6-34B

Architecture components:

  • Vision Tower: CLIP-style vision encoder with patch embeddings and bidirectional attention
  • Multimodal Projector: Projects vision features to language model dimension (Linear or MLP)
  • Language Model: LLaMA-style decoder with RoPE, GQA, and SwiGLU MLP

Structsยง

LLaVAConfig
LLaVALanguageAttention
LLaMA-style Attention with RoPE and GQA
LLaVALanguageLayer
LLaMA-style Transformer Layer
LLaVALanguageMLP
LLaMA-style MLP with SwiGLU
LLaVALanguageModel
Complete Language Model
LLaVAModelV2
Complete LLaVA Model
LLaVAMultiModalProjector
Projects vision features to language model dimension
LLaVAVisionAttention
CLIP Vision Attention (bidirectional, no causal mask)
LLaVAVisionEmbeddings
CLIP-style Vision Embeddings
LLaVAVisionEncoder
CLIP Vision Encoder
LLaVAVisionLayer
CLIP Vision Encoder Layer
LLaVAVisionMLP
CLIP Vision MLP (GELU activation)
LLaVAVisionTower
Complete Vision Tower (CLIP ViT)