Skip to content

Commit b05760a

Browse files
committed
[CI] bump mypy version to 1.16.0
Signed-off-by: Andy Xie <andy.xning@gmail.com>
1 parent caa680f commit b05760a

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ repos:
5858
entry: tools/mypy.sh 0 "local"
5959
language: python
6060
types: [python]
61-
additional_dependencies: &mypy_deps [mypy==1.11.1, types-cachetools, types-setuptools, types-PyYAML, types-requests, pydantic]
61+
additional_dependencies: &mypy_deps [mypy==1.16.0, types-cachetools,
62+
types-setuptools, types-PyYAML, types-requests, pydantic]
6263
stages: [pre-commit] # Don't run in CI
6364
- id: mypy-3.9 # TODO: Use https://github.com/pre-commit/mirrors-mypy when mypy setup is less awkward
6465
name: Run mypy for Python 3.9

vllm/entrypoints/openai/tool_parsers/hermes_tool_parser.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,6 @@ def extract_tool_calls_streaming(
237237
return delta
238238

239239
try:
240-
241240
current_tool_call = partial_json_parser.loads(
242241
tool_call_portion or "{}",
243242
flags) if tool_call_portion else None
@@ -252,7 +251,7 @@ def extract_tool_calls_streaming(
252251
# case - we haven't sent the tool name yet. If it's available, send
253252
# it. otherwise, wait until it's available.
254253
if not self.current_tool_name_sent:
255-
if (current_tool_call is None):
254+
if current_tool_call is None:
256255
return None
257256
function_name: Union[str, None] = current_tool_call.get("name")
258257
if function_name:
@@ -292,6 +291,8 @@ def extract_tool_calls_streaming(
292291
# JSON to the current partially-parsed JSON
293292
prev_arguments = (
294293
self.prev_tool_call_arr[self.current_tool_id].get("arguments"))
294+
if current_tool_call is None:
295+
return None
295296
cur_arguments = current_tool_call.get("arguments")
296297

297298
logger.debug("diffing old arguments: %s", prev_arguments)

0 commit comments

Comments
 (0)