[Bugfix][Frontend] Fix batch chat endpoint corrupting logprobs when return_token_ids is set (#47384)
Signed-off-by: David Feng <fenghourun@meta.com> Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -258,7 +258,7 @@ class OpenAIServingChatBatch(OpenAIServingChat):
|
||||
top_logprobs=output.logprobs,
|
||||
num_output_top_logprobs=request.top_logprobs,
|
||||
tokenizer=tokenizer,
|
||||
return_as_token_id=request.return_token_ids,
|
||||
return_as_token_id=request.return_tokens_as_token_ids,
|
||||
)
|
||||
else:
|
||||
logprobs = None
|
||||
|
||||
@@ -1023,6 +1023,9 @@ class BatchChatCompletionRequest(OpenAIBaseModel):
|
||||
include_stop_str_in_output: bool = False
|
||||
guided_decoding_backend: str | None = None
|
||||
echo: bool = False
|
||||
# None falls back to the server-level --return-tokens-as-token-ids default,
|
||||
# matching ChatCompletionRequest.return_tokens_as_token_ids.
|
||||
return_tokens_as_token_ids: bool | None = None
|
||||
return_token_ids: bool = False
|
||||
|
||||
@model_validator(mode="before")
|
||||
|
||||
Reference in New Issue
Block a user