Skip to content

Commit 23a6c52

Browse files
[gpt-oss][Bugfix]Fix streamableparser for missing handling of certain token_ids (#24306)
Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com>
1 parent 7812bcf commit 23a6c52

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

vllm/entrypoints/context.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,11 +238,11 @@ def append_output(self, output) -> None:
238238
# (finished=True), then the next token processed will mark the
239239
# beginning of a new message
240240
self.first_tok_of_message = output.finished
241-
tok = output.outputs[0].token_ids[0]
242-
self.parser.process(tok)
241+
for tok in output.outputs[0].token_ids:
242+
self.parser.process(tok)
243243
self._update_num_output_tokens(output.outputs[0].token_ids)
244244
# Check if the current token is part of reasoning content
245-
self._update_num_reasoning_tokens([tok])
245+
self._update_num_reasoning_tokens(output.outputs[0].token_ids)
246246
self.last_tok = tok
247247
else:
248248
# Handle the case of tool output in direct message format

0 commit comments

Comments
 (0)