Skip to content

Commit 92601d9

Browse files
committed
Removing unneeded check
Signed-off-by: avigny <47987522+avigny@users.noreply.github.com>
1 parent f1e1e38 commit 92601d9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

vllm/entrypoints/openai/tool_parsers/mistral_tool_parser.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,12 +226,12 @@ def extract_tool_calls_streaming(
226226
match_name = self.tool_call_first_attribute_name.match(raw_current_tool_call)
227227
match_arguments = self.tool_call_first_attribute_arguments.match(raw_current_tool_call)
228228
if not self.current_tool_name_finished and match_name:
229-
if self.previous_attribute_end_index is not None and match_name.end() <= self.previous_attribute_end_index:
229+
if match_name.end() <= self.previous_attribute_end_index:
230230
return self._none_or_additional_content(additional_content)
231231
self.current_element_streaming = "name"
232232
self.current_attribute_start_index = match_name.end()
233233
elif not self.current_tool_arguments_finished and match_arguments:
234-
if self.previous_attribute_end_index is not None and match_arguments.end() <= self.previous_attribute_end_index:
234+
if match_arguments.end() <= self.previous_attribute_end_index:
235235
return self._none_or_additional_content(additional_content)
236236
self.current_element_streaming = "arguments"
237237
self.current_attribute_start_index = match_arguments.end() - 1 # the `{` is the last IN the match part. We want it as the start index element

0 commit comments

Comments
 (0)