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 <ashar786khan@gmail.com> * ci: format code Signed-off-by: Ashar <ashar786khan@gmail.com> --------- Signed-off-by: coder3101 <ashar786khan@gmail.com> Signed-off-by: Ashar <ashar786khan@gmail.com>
This commit is contained in:
@@ -389,6 +389,21 @@ class Model:
|
|||||||
for expert in layer.block_sparse_moe.experts: # ty:ignore[possibly-missing-attribute, not-iterable]
|
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]
|
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.
|
# Granite MoE Hybrid - attention layers with shared_mlp.
|
||||||
with suppress(Exception):
|
with suppress(Exception):
|
||||||
try_add("mlp.down_proj", layer.shared_mlp.output_linear) # ty:ignore[possibly-missing-attribute]
|
try_add("mlp.down_proj", layer.shared_mlp.output_linear) # ty:ignore[possibly-missing-attribute]
|
||||||
|
|||||||
Reference in New Issue
Block a user