[CI] Fix mypy for vllm/reasoning (#35742)

Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Co-authored-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
This commit is contained in:
Martin Hickey
2026-03-12 12:21:33 +00:00
committed by GitHub
co-authored by Harry Mellor
parent 5282c7d4d0
commit 7f1f36bf91
21 changed files with 143 additions and 158 deletions
+5 -3
View File
@@ -4,7 +4,7 @@
import functools
import json
from collections.abc import Collection, Set
from collections.abc import Collection, Sequence, Set
from pathlib import Path
from typing import Any, Literal, overload
@@ -348,7 +348,9 @@ class Grok2Tokenizer(TokenizerLike):
tokens = self._maybe_truncate(tokens, max_length)
return tokens
def decode(self, ids: list[int] | int, skip_special_tokens: bool = False) -> str:
def decode(
self, ids: Sequence[int] | int, skip_special_tokens: bool = False
) -> str:
if isinstance(ids, int):
ids = [ids]
if skip_special_tokens:
@@ -371,7 +373,7 @@ class Grok2Tokenizer(TokenizerLike):
return [self._token_to_id.get(token, self._unk_token_id) for token in tokens]
def convert_ids_to_tokens(
self, ids: list[int], skip_special_tokens: bool = False
self, ids: Sequence[int], skip_special_tokens: bool = False
) -> list[str]:
tokens = []
for token_id in ids: