[Bugfix] fixed top_logprobs: -1 does not appear to work as intended (#26470)

Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com>
This commit is contained in:
Chauncey
2025-10-11 00:41:17 +08:00
committed by GitHub
parent cddce79fda
commit 910abdbd08
2 changed files with 16 additions and 1 deletions

View File

@@ -1643,7 +1643,7 @@ class OpenAIServingChat(OpenAIServing):
bytes=list(token.encode("utf-8", errors="replace")),
)
for i, p in enumerate(logprobs.items())
if top_logprobs and i < top_logprobs
if (top_logprobs and i < top_logprobs or top_logprobs == -1)
]
def _create_chat_logprobs(