[Mypy] Fix mypy typing for N/O models (#54142)
Signed-off-by: Taneem Ibrahim <taneem.ibrahim@gmail.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user