Unverified Commit 23a6c528 authored by Chauncey's avatar Chauncey Committed by GitHub
Browse files

[gpt-oss][Bugfix]Fix streamableparser for missing handling of certain token_ids (#24306)


Signed-off-by: default avatarchaunceyjiang <chaunceyjiang@gmail.com>
parent 7812bcf2
...@@ -238,11 +238,11 @@ class StreamingHarmonyContext(HarmonyContext): ...@@ -238,11 +238,11 @@ class StreamingHarmonyContext(HarmonyContext):
# (finished=True), then the next token processed will mark the # (finished=True), then the next token processed will mark the
# beginning of a new message # beginning of a new message
self.first_tok_of_message = output.finished self.first_tok_of_message = output.finished
tok = output.outputs[0].token_ids[0] for tok in output.outputs[0].token_ids:
self.parser.process(tok) self.parser.process(tok)
self._update_num_output_tokens(output.outputs[0].token_ids) self._update_num_output_tokens(output.outputs[0].token_ids)
# Check if the current token is part of reasoning content # Check if the current token is part of reasoning content
self._update_num_reasoning_tokens([tok]) self._update_num_reasoning_tokens(output.outputs[0].token_ids)
self.last_tok = tok self.last_tok = tok
else: else:
# Handle the case of tool output in direct message format # Handle the case of tool output in direct message format
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment