Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
8a193031
Unverified
Commit
8a193031
authored
Aug 21, 2025
by
Chen Zhang
Committed by
GitHub
Aug 21, 2025
Browse files
[BugFix][gpt-oss] Fix Chat Completion with Multiple Output Message (#23318)
Signed-off-by:
Chen Zhang
<
zhangch99@outlook.com
>
parent
603fbbbc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
9 deletions
+5
-9
vllm/entrypoints/harmony_utils.py
vllm/entrypoints/harmony_utils.py
+5
-9
No files found.
vllm/entrypoints/harmony_utils.py
View file @
8a193031
...
@@ -329,23 +329,19 @@ def parse_chat_output(
...
@@ -329,23 +329,19 @@ def parse_chat_output(
token_ids
:
Sequence
[
int
])
->
tuple
[
Optional
[
str
],
Optional
[
str
],
bool
]:
token_ids
:
Sequence
[
int
])
->
tuple
[
Optional
[
str
],
Optional
[
str
],
bool
]:
parser
=
parse_output_into_messages
(
token_ids
)
parser
=
parse_output_into_messages
(
token_ids
)
output_msgs
=
parser
.
messages
output_msgs
=
parser
.
messages
is_tool_call
=
False
# TODO: update this when tool call is supported
if
len
(
output_msgs
)
==
0
:
if
len
(
output_msgs
)
==
0
:
# The generation has stopped during reasoning.
# The generation has stopped during reasoning.
is_tool_call
=
False
reasoning_content
=
parser
.
current_content
reasoning_content
=
parser
.
current_content
final_content
=
None
final_content
=
None
elif
len
(
output_msgs
)
==
1
:
elif
len
(
output_msgs
)
==
1
:
# The generation has stopped during final message.
# The generation has stopped during final message.
is_tool_call
=
False
reasoning_content
=
output_msgs
[
0
].
content
[
0
].
text
reasoning_content
=
output_msgs
[
0
].
content
[
0
].
text
final_content
=
parser
.
current_content
final_content
=
parser
.
current_content
else
:
else
:
if
len
(
output_msgs
)
!=
2
:
reasoning_msg
=
output_msgs
[:
-
1
]
raise
ValueError
(
final_msg
=
output_msgs
[
-
1
]
"Expected 2 output messages (reasoning and final), "
reasoning_content
=
"
\n
"
.
join
(
f
"but got
{
len
(
output_msgs
)
}
."
)
[
msg
.
content
[
0
].
text
for
msg
in
reasoning_msg
])
reasoning_msg
,
final_msg
=
output_msgs
reasoning_content
=
reasoning_msg
.
content
[
0
].
text
final_content
=
final_msg
.
content
[
0
].
text
final_content
=
final_msg
.
content
[
0
].
text
is_tool_call
=
final_msg
.
recipient
is
not
None
return
reasoning_content
,
final_content
,
is_tool_call
return
reasoning_content
,
final_content
,
is_tool_call
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment