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
No known key found for this signature in database
GPG key ID: CE6A7756AD520E0F

View file

@ -106,6 +106,12 @@ class Model:
for expert in layer.mlp.experts:
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.
assert matrices