{"record":{"id":"499d091a8106b3a1","repo":"huggingface/candle","slug":"unsupported-projector-activation","errorCode":null,"errorMessage":"Unsupported projector activation: {}","messagePattern":"Unsupported projector activation: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"candle-transformers/src/models/voxtral/model.rs","lineNumber":706,"sourceCode":"\nimpl VoxtralMultiModalProjector {\n    pub fn new(cfg: &VoxtralConfig, vb: VarBuilder) -> Result<Self> {\n        let linear_1 = linear_no_bias(\n            cfg.audio_config.intermediate_size,\n            cfg.text_config.hidden_size,\n            vb.pp(\"linear_1\"),\n        )?;\n\n        let linear_2 = linear_no_bias(\n            cfg.text_config.hidden_size,\n            cfg.text_config.hidden_size,\n            vb.pp(\"linear_2\"),\n        )?;\n\n        let activation = match cfg.projector_hidden_act.as_str() {\n            \"gelu\" => candle_nn::Activation::Gelu,\n            \"relu\" => candle_nn::Activation::Relu,\n            _ => candle::bail!(\n                \"Unsupported projector activation: {}\",\n                cfg.projector_hidden_act\n            ),\n        };\n\n        Ok(Self {\n            linear_1,\n            linear_2,\n            activation,\n        })\n    }\n\n    pub fn forward(&self, audio_features: &Tensor) -> Result<Tensor> {\n        let x = self.linear_1.forward(audio_features)?;\n        let x = x.apply(&self.activation)?;\n        self.linear_2.forward(&x)\n    }\n}","sourceCodeStart":688,"sourceCodeEnd":724,"githubUrl":"https://github.com/huggingface/candle/blob/d5fee525bfde3273eb7c9b75fd2bc4937be867ca/candle-transformers/src/models/voxtral/model.rs#L688-L724","documentation":"The Voxtral multi-modal projector maps projector_hidden_act from the config to a candle activation, accepting only \"gelu\" and \"relu\"; anything else bails with 'Unsupported projector activation'. It mirrors the encoder activation whitelist but applies to the projector's hidden layer.","triggerScenarios":"Building the projector with a VoxtralConfig whose projector_hidden_act string is not \"gelu\" or \"relu\" (e.g. \"silu\", \"gelu_new\").","commonSituations":"Checkpoint config declaring silu for the projector; hand-ported Voxtral config; typo when constructing the config in Rust.","solutions":["Set projector_hidden_act to \"gelu\" or \"relu\" in the VoxtralConfig","Patch the match in the projector constructor to support the activation your checkpoint uses (e.g. map \"silu\" to Activation::Silu)","Verify the expected activation from the model card/config.json and align the Rust config"],"exampleFix":"// before\nlet cfg = VoxtralConfig { projector_hidden_act: \"silu\".into(), .. };\n// after\nlet cfg = VoxtralConfig { projector_hidden_act: \"gelu\".into(), .. };","handlingStrategy":"validation","validationCode":"if !matches!(cfg.projector_hidden_act.as_str(), \"gelu\" | \"relu\") {\n    return Err(anyhow::anyhow!(\"projector activation {:?} unsupported\", cfg.projector_hidden_act));\n}","typeGuard":null,"tryCatchPattern":"match VoxtralModel::new(&cfg, vb) {\n    Err(e) if e.to_string().contains(\"Unsupported projector activation\") => {\n        anyhow::bail!(\"set projector_hidden_act to gelu/relu or patch the projector\")\n    }\n    r => r?,\n}","preventionTips":["Validate projector_hidden_act alongside other config fields at load time","Alias HF activation names to candle Activation variants in one place","Confirm projector activation from the official Voxtral config before loading"],"tags":["rust","candle","voxtral","config","unsupported-feature"],"backgroundTag":"unsupported-activation-function","analyzedSha":"d5fee525bfde3273eb7c9b75fd2bc4937be867ca","analyzedAt":"2026-09-02T00:15:47.023Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}