Skip to content

Commit 4e9de4e

Browse files
Clean up context.py - remove parser error handling, use main branch version
1 parent edc7905 commit 4e9de4e

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

vllm/entrypoints/context.py

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -239,18 +239,11 @@ def append_output(self, output) -> None:
239239
# beginning of a new message
240240
self.first_tok_of_message = output.finished
241241
tok = output.outputs[0].token_ids[0]
242-
try:
243-
self.parser.process(tok)
244-
# Only update these if parsing succeeded
245-
self._update_num_output_tokens(output.outputs[0].token_ids)
246-
# Check if the current token is part of reasoning content
247-
self._update_num_reasoning_tokens([tok])
248-
self.last_tok = tok
249-
except Exception as e:
250-
# Log the error but continue processing to avoid breaking stream
251-
logger.warning("Parser error processing token %s: %s", tok, e)
252-
# Skip this token to avoid parser state corruption
253-
# Don't update last_tok or token counts for failed tokens
242+
self.parser.process(tok)
243+
self._update_num_output_tokens(output.outputs[0].token_ids)
244+
# Check if the current token is part of reasoning content
245+
self._update_num_reasoning_tokens([tok])
246+
self.last_tok = tok
254247
else:
255248
# Handle the case of tool output in direct message format
256249
assert len(output) == 1, "Tool output should be a single message"

0 commit comments

Comments
 (0)