{"record":{"id":"592a137e3793ec7a","repo":"huggingface/candle","slug":"alibi-is-not-supported","errorCode":null,"errorMessage":"alibi is not supported","messagePattern":"alibi is not supported","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"candle-transformers/src/models/falcon.rs","lineNumber":76,"sourceCode":"            use_cache: true,\n            bos_token_id: 11,\n            eos_token_id: 11,\n            hidden_dropout: 0.0,\n            attention_dropout: 0.0,\n            n_head_kv: None,\n            alibi: false,\n            new_decoder_architecture: false,\n            multi_query: true,\n            parallel_attn: true,\n            bias: false,\n        }\n    }\n}\n\nimpl Config {\n    pub fn validate(&self) -> Result<()> {\n        if self.alibi {\n            candle::bail!(\"alibi is not supported\");\n        }\n        if self.new_decoder_architecture {\n            candle::bail!(\"new_decoder_architecture is not supported\");\n        }\n        if self.n_head_kv.is_some() {\n            candle::bail!(\"n_head_kv is not supported\");\n        }\n        Ok(())\n    }\n\n    // https://huggingface.co/tiiuae/falcon-7b/blob/main/config.json\n    pub fn falcon7b() -> Self {\n        // This is currently on par with the defaults, the defaults come from the Python default\n        // arguments for the config initialization whereas the following come from the json config.\n        Self {\n            vocab_size: 65024,\n            hidden_size: 4544,\n            num_hidden_layers: 32,","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/huggingface/candle/blob/d5fee525bfde3273eb7c9b75fd2bc4937be867ca/candle-transformers/src/models/falcon.rs#L58-L94","documentation":"Falcon's Config::validate in candle-transformers rejects configurations with alibi set to true, because the candle Falcon implementation only supports rotary position embeddings (rotary) and does not implement ALiBi positional biases. bail! converts this into an immediate Err before any model weights are loaded.","triggerScenarios":"Deserializing a falcon Config (e.g. from a HuggingFace config.json) whose \"alibi\" field is true and then calling config.validate(), typically from main before building the model.","commonSituations":"Pointing candle at a Falcon variant that uses ALiBi (e.g. some falcon-40b style or fine-tuned checkpoints with alibi:true in config.json) instead of a rotary-based checkpoint like falcon-7b/instruct.","solutions":["Use a checkpoint whose config.json has \"alibi\": false (e.g. tiiuae/falcon-7b or falcon-7b-instruct).","If the config came from a local file, edit config.json to set alibi to false only if you have verified the weights are rotary-based; otherwise switch models.","Call config.validate() early in your own code (right after loading) so the mismatch fails fast with a clear message rather than mid-load."],"exampleFix":"// before: loading a checkpoint with alibi: true\nlet config = Config::from_json(&json)?;\nconfig.validate()?;\n// after: pick a rotary-based Falcon variant\nlet config = Config::falcon7b(); // alibi: false, validated values\nconfig.validate()?;","handlingStrategy":"validation","validationCode":"let config = Config::from_json(&json)?;\nif config.alibi {\n    return Err(anyhow::anyhow!(\"checkpoint uses ALiBi; use a rotary Falcon checkpoint (alibi: false)\"));\n}\nconfig.validate()?;","typeGuard":"fn supports_alibi_false(c: &Config) -> bool { !c.alibi }","tryCatchPattern":"match config.validate() {\n    Ok(()) => load_model(config),\n    Err(e) if e.to_string().contains(\"alibi\") => eprintln!(\"switch to a rotary-based falcon checkpoint: {e}\"),\n    Err(e) => return Err(e.into()),\n}","preventionTips":["Inspect the checkpoint's config.json (alibi field) before downloading.","Stick to known-supported checkpoints like tiiuae/falcon-7b(-instruct).","Call validate() immediately after config load, before allocating weights."],"tags":["config","falcon","unsupported-feature","candle"],"backgroundTag":"unsupported-model-config","analyzedSha":"d5fee525bfde3273eb7c9b75fd2bc4937be867ca","analyzedAt":"2026-09-02T00:15:47.023Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}