[CI] Fix mypy pre-commit errors on main (#36882)
Signed-off-by: Thomas Parnell <tpa@zurich.ibm.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
53ec16a705
commit
abcffbba8c
@@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
import contextlib
|
import contextlib
|
||||||
import json
|
import json
|
||||||
|
from collections.abc import Sequence
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Any, overload
|
from typing import Any, overload
|
||||||
|
|
||||||
@@ -299,7 +300,9 @@ class KimiAudioTokenizer(TokenizerLike):
|
|||||||
tokens = self._maybe_truncate(tokens, max_length)
|
tokens = self._maybe_truncate(tokens, max_length)
|
||||||
return tokens
|
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."""
|
"""Decode token IDs to text, optionally skipping special tokens."""
|
||||||
if isinstance(ids, int):
|
if isinstance(ids, int):
|
||||||
ids = [ids]
|
ids = [ids]
|
||||||
@@ -321,7 +324,7 @@ class KimiAudioTokenizer(TokenizerLike):
|
|||||||
return [self._token_to_id.get(token, self._unk_token_id) for token in tokens]
|
return [self._token_to_id.get(token, self._unk_token_id) for token in tokens]
|
||||||
|
|
||||||
def convert_ids_to_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]:
|
) -> list[str]:
|
||||||
tokens = []
|
tokens = []
|
||||||
for token_id in ids:
|
for token_id in ids:
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ class ToolParser:
|
|||||||
# tool_choice: "Forced Function" or "required" will override
|
# tool_choice: "Forced Function" or "required" will override
|
||||||
# structured output json settings to make tool calling work correctly
|
# structured output json settings to make tool calling work correctly
|
||||||
request.structured_outputs = StructuredOutputsParams(
|
request.structured_outputs = StructuredOutputsParams(
|
||||||
json=json_schema_from_tool
|
json=json_schema_from_tool # type: ignore[call-arg]
|
||||||
)
|
)
|
||||||
request.response_format = None
|
request.response_format = None
|
||||||
if isinstance(request, ResponsesRequest):
|
if isinstance(request, ResponsesRequest):
|
||||||
|
|||||||
Reference in New Issue
Block a user