[Transformers backend] Ignore MTP weights when num_nextn_predict_layers=0 (#34888)

Signed-off-by: SteadfastAsArt <695488173@qq.com>
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
This commit is contained in:
SteadfastAsArt
2026-02-28 03:39:23 +08:00
committed by GitHub
parent 29b35477b0
commit 2decec9856
2 changed files with 15 additions and 2 deletions

View File

@@ -311,8 +311,9 @@ class AutoWeightsLoader:
continue
named_parameters = module.named_parameters(recurse=True)
desc_param_keys = {
base_prefix + k for k, _ in module.named_parameters(recurse=True)
maybe_prefix(base_prefix, k) for k, _ in named_parameters
}
msg = (
f"There is no module or parameter named {prefix!r} "