{"record":{"id":"5ff86a8673f24df2","repo":"huggingface/candle","slug":"seanet-lstm-is-not-supported","errorCode":null,"errorMessage":"seanet lstm is not supported","messagePattern":"seanet lstm is not supported","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"candle-transformers/src/models/mimi/seanet.rs","lineNumber":162,"sourceCode":"#[derive(Debug, Clone)]\nstruct EncoderLayer {\n    residuals: Vec<SeaNetResnetBlock>,\n    downsample: StreamableConv1d,\n}\n\n#[derive(Debug, Clone)]\npub struct SeaNetEncoder {\n    init_conv1d: StreamableConv1d,\n    activation: candle_nn::Activation,\n    layers: Vec<EncoderLayer>,\n    final_conv1d: StreamableConv1d,\n    span: tracing::Span,\n}\n\nimpl SeaNetEncoder {\n    pub fn new(cfg: &Config, vb: VarBuilder) -> Result<Self> {\n        if cfg.lstm > 0 {\n            candle::bail!(\"seanet lstm is not supported\")\n        }\n        let n_blocks = 2 + cfg.ratios.len();\n        let mut mult = 1usize;\n        let init_norm = if cfg.disable_norm_outer_blocks >= 1 {\n            None\n        } else {\n            Some(cfg.norm)\n        };\n        let mut layer_idx = 0;\n        let vb = vb.pp(\"layers\");\n        let init_conv1d = StreamableConv1d::new(\n            cfg.channels,\n            mult * cfg.n_filters,\n            cfg.kernel_size,\n            /* stride */ 1,\n            /* dilation */ 1,\n            /* groups */ 1,\n            /* bias */ true,","sourceCodeStart":144,"sourceCodeEnd":180,"githubUrl":"https://github.com/huggingface/candle/blob/d5fee525bfde3273eb7c9b75fd2bc4937be867ca/candle-transformers/src/models/mimi/seanet.rs#L144-L180","documentation":"SeaNetEncoder::new in the mimi model refuses to build when the codec config requests LSTM layers (cfg.lstm > 0). The candle mimi implementation only implements the convolutional SeaNet blocks, so any config with an LSTM tail is rejected up front with this bail!.","triggerScenarios":"Calling SeaNetEncoder::new (directly or via mimi encoder construction) with a Config whose lstm field is greater than 0, e.g. loading mimi checkpoints/configs derived from Moshi variants that enable the LSTM tail.","commonSituations":"Porting an official Moshi/mimi config JSON that has \"lstm\": 2; using a pretrained checkpoint variant that candle does not implement; copy-pasting a config from the original Kyutai/MLX codebase.","solutions":["Set lstm to 0 in the mimi Config before constructing SeaNetEncoder","Use a mimi checkpoint whose config disables the LSTM tail (conv-only variant)","If LSTM support is required, implement the SeaNet LSTM blocks upstream or use a runtime that supports them"],"exampleFix":"// before\nlet cfg = Config { lstm: 2, ..base_cfg };\nlet encoder = SeaNetEncoder::new(&cfg, vb)?; // panics/bails\n// after\nlet cfg = Config { lstm: 0, ..base_cfg };\nlet encoder = SeaNetEncoder::new(&cfg, vb)?;","handlingStrategy":"validation","validationCode":"if cfg.lstm > 0 {\n    return Err(anyhow::anyhow!(\"config requires seanet lstm which candle mimi does not support; set lstm = 0\"));\n}\nlet encoder = SeaNetEncoder::new(&cfg, vb)?;","typeGuard":"fn supports_seanet(cfg: &Config) -> bool { cfg.lstm == 0 }","tryCatchPattern":"let encoder = match SeaNetEncoder::new(&cfg, vb) {\n    Ok(e) => e,\n    Err(e) if e.to_string().contains(\"seanet lstm is not supported\") => {\n        return Err(anyhow::anyhow!(\"disable lstm in the mimi config\"))\n    }\n    Err(e) => return Err(e.into()),\n};","preventionTips":["Validate cfg.lstm == 0 before building any mimi component","Prefer conv-only mimi checkpoints when using candle","Keep a central config-validity check shared by encoder and decoder construction"],"tags":["rust","candle","mimi","audio","unsupported-config"],"backgroundTag":"unsupported-model-config","analyzedSha":"d5fee525bfde3273eb7c9b75fd2bc4937be867ca","analyzedAt":"2026-09-02T00:15:47.023Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}