[Bugfix][Frontend] Fix validation of logprobs in ChatCompletionRequest (#14352)

Signed-off-by: Sebastian Schönnenbeck <sebastian.schoennenbeck@comma-soft.com>
This commit is contained in:
Sebastian Schoennenbeck 2025-03-18 13:50:05 +01:00 committed by GitHub
parent 414919138b
commit dd732028f5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -548,7 +548,7 @@ class ChatCompletionRequest(OpenAIBaseModel):
if top_logprobs < 0:
raise ValueError("`top_logprobs` must be a positive value.")
if not data.get("logprobs"):
if top_logprobs > 0 and not data.get("logprobs"):
raise ValueError(
"when using `top_logprobs`, `logprobs` must be set to true."
)