From 906d96f78a3d65984db59f22400867eb152c0d0f Mon Sep 17 00:00:00 2001 From: Ashar Date: Wed, 3 Jun 2026 17:58:05 +0530 Subject: [PATCH] feat: add support for LiquidAI/LFM2.5 models (#344) * feat: add support for LiquidAI/LFM2.5 models * add lint supress and obey gemini Signed-off-by: coder3101 * ci: format code Signed-off-by: Ashar --------- Signed-off-by: coder3101 Signed-off-by: Ashar --- src/heretic/model.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/heretic/model.py b/src/heretic/model.py index 41a8e71..2513091 100644 --- a/src/heretic/model.py +++ b/src/heretic/model.py @@ -389,6 +389,21 @@ class Model: for expert in layer.block_sparse_moe.experts: # ty:ignore[possibly-missing-attribute, not-iterable] try_add("mlp.down_proj", expert.w2) # ty:ignore[possibly-missing-attribute] + # LFM dense operator blocks. + with suppress(Exception): + try_add("attn.o_proj", layer.conv.out_proj) # ty:ignore[possibly-missing-attribute] + + with suppress(Exception): + try_add("mlp.down_proj", layer.feed_forward.w2) # ty:ignore[possibly-missing-attribute] + + # LFM transformer blocks. + with suppress(Exception): + try_add("attn.o_proj", layer.self_attn.out_proj) # ty:ignore[possibly-missing-attribute] + + with suppress(Exception): + for expert in layer.feed_forward.experts: # ty:ignore[possibly-missing-attribute, not-iterable] + try_add("mlp.down_proj", expert.w2) # ty:ignore[possibly-missing-attribute] + # Granite MoE Hybrid - attention layers with shared_mlp. with suppress(Exception): try_add("mlp.down_proj", layer.shared_mlp.output_linear) # ty:ignore[possibly-missing-attribute]