{"record":{"id":"660037a42628b5a4","repo":"huggingface/candle","slug":"unsupported-mm-projector-type","errorCode":null,"errorMessage":"Unsupported MM projector type: {}","messagePattern":"Unsupported MM projector type: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"candle-transformers/src/models/llava/mod.rs","lineNumber":119,"sourceCode":"                    config.hidden_size,\n                    vb.pp(\"model.mm_projector.0\"),\n                )?);\n                for i in 1..mlp_depth {\n                    modules = modules.add(Activation::Gelu).add(linear(\n                        config.hidden_size,\n                        config.hidden_size,\n                        vb.pp(format!(\"model.mm_projector.{}\", i * 2)),\n                    )?);\n                }\n                modules\n            };\n            Ok(Self { modules })\n        } else if config.mm_projector_type == \"identity\" {\n            Ok(Self {\n                modules: seq().add(IdentityMap {}),\n            })\n        } else {\n            bail!(\n                \"Unsupported MM projector type: {}\",\n                config.mm_projector_type\n            )\n        }\n    }\n\n    pub fn forward(&self, x: &Tensor) -> Result<Tensor> {\n        self.modules.forward(x)\n    }\n}\n\npub struct ClipVisionTower {\n    model: ClipVisionTransformer,\n    select_layer: isize,\n    select_feature_method: String,\n    pub config: ClipVisionConfig,\n}\n","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/huggingface/candle/blob/d5fee525bfde3273eb7c9b75fd2bc4937be867ca/candle-transformers/src/models/llava/mod.rs#L101-L137","documentation":"Llava's multimodal projector builder supports only a fixed set of mm_projector_type values (e.g. mlp2x_gelu-like sequences and identity). Any other string in config.mm_projector_type falls through to this bail at load time.","triggerScenarios":"Loading a LLaVA checkpoint whose config.mm_projector_type is an unsupported string (e.g. \"resampler\", \"lin\", or a new transformers value) or the field missing/garbled so it matches neither supported branch.","commonSituations":"Using a LLaVA-NeXT/1.6 or variant with a projector type the candle port doesn't implement; typos in config; newer model releases ahead of the candle implementation.","solutions":["Use a LLaVA checkpoint with a supported mm_projector_type (e.g. \"mlp2x_gelu\" or \"identity\")","Check the match arms in llava/mod.rs load() for the exact supported strings and set config accordingly","Patch the projector builder to add the missing projector type"],"exampleFix":"// before (config.json)\n{\"mm_projector_type\": \"resampler\", ...}\n// after\n{\"mm_projector_type\": \"mlp2x_gelu\", ...}","handlingStrategy":"validation","validationCode":"let supported = [\"mlp2x_gelu\", \"identity\"]; // match load()'s accepted values\nif !supported.contains(&config.mm_projector_type.as_str()) {\n    return Err(format!(\"unsupported mm_projector_type: {}\", config.mm_projector_type));\n}","typeGuard":"fn has_supported_projector(c: &llava::Config) -> bool {\n    matches!(c.mm_projector_type.as_str(), \"mlp2x_gelu\" | \"identity\")\n}","tryCatchPattern":"match llava::MultimodalProjector::load(vb, config) {\n    Err(e) if e.to_string().contains(\"Unsupported MM projector type\") =>\n        Err(anyhow!(\"use a LLaVA checkpoint with a supported projector type or patch load()\")),\n    r => r.map_err(Into::into),\n}","preventionTips":["Check mm_projector_type in config.json before loading LLaVA checkpoints","Prefer LLaVA variants whose projector is mlp2x_gelu or identity with candle","Read the match arms in llava/mod.rs to know the current supported set"],"tags":["config","llava","multimodal"],"backgroundTag":"unsupported-architecture-config","analyzedSha":"d5fee525bfde3273eb7c9b75fd2bc4937be867ca","analyzedAt":"2026-09-02T00:15:47.023Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}