[Mypy] Fix mypy typing for N/O models (#54142)

Signed-off-by: Taneem Ibrahim <taneem.ibrahim@gmail.com>
This commit is contained in:
Taneem Ibrahim
2026-09-18 12:50:01 +01:00
committed by GitHub
parent e562003adb
commit 2b8a5495a8
19 changed files with 321 additions and 143 deletions
+12 -5
View File
@@ -52,7 +52,9 @@ class OpenPanguMultiTokenPredictorLayer(DeepSeekMultiTokenPredictorLayer):
def __init__(self, vllm_config: VllmConfig, prefix: str) -> None:
nn.Module.__init__(self)
config = vllm_config.speculative_config.draft_model_config.hf_config
speculative_config = vllm_config.speculative_config
assert speculative_config is not None
config = speculative_config.draft_model_config.hf_config
self.config = config
quant_config = vllm_config.quant_config
@@ -200,10 +202,15 @@ class OpenPanguMTP(nn.Module):
break
else:
for mapping in expert_params_mapping:
param_name, weight_name, expert_id, shard_id = mapping
if weight_name not in name:
(
expert_param_name,
expert_weight_name,
expert_id,
expert_shard_id,
) = mapping
if expert_weight_name not in name:
continue
name = name.replace(weight_name, param_name)
name = name.replace(expert_weight_name, expert_param_name)
param = params_dict[name]
weight_loader = param.weight_loader
@@ -211,7 +218,7 @@ class OpenPanguMTP(nn.Module):
param,
loaded_weight,
name,
shard_id=shard_id,
shard_id=expert_shard_id,
expert_id=expert_id,
)
break