Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
change
sglang
Commits
2e0f94ab
Unverified
Commit
2e0f94ab
authored
Mar 28, 2025
by
lambert0312
Committed by
GitHub
Mar 27, 2025
Browse files
[Fix] fix output_top_logprobs is not exist (#4597)
parent
18317ddc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
python/sglang/srt/openai_api/adapter.py
python/sglang/srt/openai_api/adapter.py
+6
-4
No files found.
python/sglang/srt/openai_api/adapter.py
View file @
2e0f94ab
...
@@ -1119,7 +1119,9 @@ def v1_chat_generate_response(
...
@@ -1119,7 +1119,9 @@ def v1_chat_generate_response(
if
logprobs
:
if
logprobs
:
logprobs
=
to_openai_style_logprobs
(
logprobs
=
to_openai_style_logprobs
(
output_token_logprobs
=
ret_item
[
"meta_info"
][
"output_token_logprobs"
],
output_token_logprobs
=
ret_item
[
"meta_info"
][
"output_token_logprobs"
],
output_top_logprobs
=
ret_item
[
"meta_info"
][
"output_top_logprobs"
],
output_top_logprobs
=
ret_item
[
"meta_info"
].
get
(
"output_top_logprobs"
,
None
),
)
)
token_logprobs
=
[]
token_logprobs
=
[]
for
token_idx
,
(
token
,
logprob
)
in
enumerate
(
for
token_idx
,
(
token
,
logprob
)
in
enumerate
(
...
@@ -1329,9 +1331,9 @@ async def v1_chat_completions(
...
@@ -1329,9 +1331,9 @@ async def v1_chat_completions(
output_token_logprobs
=
content
[
"meta_info"
][
output_token_logprobs
=
content
[
"meta_info"
][
"output_token_logprobs"
"output_token_logprobs"
][
n_prev_token
:],
][
n_prev_token
:],
output_top_logprobs
=
content
[
"meta_info"
]
[
output_top_logprobs
=
content
[
"meta_info"
]
.
get
(
"output_top_logprobs"
"output_top_logprobs"
,
[]
]
[
n_prev_token
:],
)
[
n_prev_token
:],
)
)
n_prev_token
=
len
(
n_prev_token
=
len
(
...
...
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