[Mypy Fix] Mypy fix for "vllm/model_executor/models/[cC][dD]" (#52003)

This commit is contained in:
Wentao Ye
2026-08-13 11:33:55 +08:00
committed by GitHub
parent 15227b934a
commit 9a276d6375
24 changed files with 153 additions and 66 deletions
+3 -1
View File
@@ -58,6 +58,7 @@ class CohereEagleModel(nn.Module):
start_layer_id: int = 0,
) -> None:
super().__init__()
assert vllm_config.speculative_config is not None
self.config = vllm_config.speculative_config.draft_model_config.hf_config
self.quant_config = get_draft_quant_config(vllm_config)
@@ -137,6 +138,7 @@ class CohereEagleModel(nn.Module):
class EagleCohereForCausalLM(CohereForCausalLM):
def __init__(self, *, vllm_config: VllmConfig, prefix: str = ""):
nn.Module.__init__(self)
assert vllm_config.speculative_config is not None
self.config = vllm_config.speculative_config.draft_model_config.hf_config
# Flags checked by the speculative proposer to decide whether to share
# embed_tokens / lm_head with the target model. Cohere EAGLE checkpoints
@@ -160,7 +162,7 @@ class EagleCohereForCausalLM(CohereForCausalLM):
def embed_input_ids(self, input_ids: torch.Tensor) -> torch.Tensor:
return self.model.embed_input_ids(input_ids)
def forward(
def forward( # type: ignore[override]
self,
input_ids: torch.Tensor,
positions: torch.Tensor,