Support Phi-3.5-MoE

This commit is contained in:
Philipp Emanuel Weidmann
2025-10-14 11:23:53 +05:30
parent 8b827ee386
commit 7ed0cb1ffb
+6
View File
@@ -106,6 +106,12 @@ class Model:
for expert in layer.mlp.experts: for expert in layer.mlp.experts:
try_add(expert.down_proj.weight) try_add(expert.down_proj.weight)
# Phi-3.5-MoE (and possibly others).
if not matrices:
with suppress(Exception):
for expert in layer.block_sparse_moe.experts:
try_add(expert.w2.weight)
# We need at least one MLP down-projection. # We need at least one MLP down-projection.
assert matrices assert matrices