Unverified Commit abcffbba authored by Thomas Parnell's avatar Thomas Parnell Committed by GitHub
Browse files

[CI] Fix mypy pre-commit errors on main (#36882)


Signed-off-by: default avatarThomas Parnell <tpa@zurich.ibm.com>
Co-authored-by: default avatarClaude Opus 4.6 <noreply@anthropic.com>
parent 53ec16a7
......@@ -4,6 +4,7 @@
import contextlib
import json
from collections.abc import Sequence
from pathlib import Path
from typing import Any, overload
......@@ -299,7 +300,9 @@ class KimiAudioTokenizer(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:
"""Decode token IDs to text, optionally skipping special tokens."""
if isinstance(ids, int):
ids = [ids]
......@@ -321,7 +324,7 @@ class KimiAudioTokenizer(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:
......
......@@ -68,7 +68,7 @@ class ToolParser:
# tool_choice: "Forced Function" or "required" will override
# structured output json settings to make tool calling work correctly
request.structured_outputs = StructuredOutputsParams(
json=json_schema_from_tool
json=json_schema_from_tool # type: ignore[call-arg]
)
request.response_format = None
if isinstance(request, ResponsesRequest):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment