Skip to content

Commit ae851f4

Browse files
committed
Check only end_token_id during streaming
Signed-off-by: hdlj-h <hubert@hcompany.ai>
1 parent c7d58f4 commit ae851f4

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

tests/reasoning/test_base_thinking_reasoning_parser.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@ def test_is_reasoning_end_streaming(self, test_tokenizer):
155155
)
156156
assert (
157157
parser.is_reasoning_end_streaming(
158-
[1, start_token_id, 2, end_token_id, 2, start_token_id],
159-
[end_token_id, 2, start_token_id],
158+
[1, start_token_id, 2, end_token_id, 2, start_token_id, 2],
159+
[2],
160160
)
161161
is False
162162
)

vllm/reasoning/basic_parsers.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,10 @@ def is_reasoning_end(self, input_ids: list[int]) -> bool:
7777
def is_reasoning_end_streaming(
7878
self, input_ids: list[int], delta_ids: list[int]
7979
) -> bool:
80-
return self.is_reasoning_end(delta_ids)
80+
# We only check the end token beause interleaved reasoning and content is not
81+
# compatible with the current structured output manager.
82+
end_token_id = self.end_token_id
83+
return end_token_id in delta_ids
8184

8285
def extract_content_ids(self, input_ids: list[int]) -> list[int]:
8386
"""

0 commit comments

Comments
 (0)