Unverified Commit dd732028 authored by Sebastian Schoennenbeck's avatar Sebastian Schoennenbeck Committed by GitHub
Browse files

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


Signed-off-by: default avatarSebastian Schönnenbeck <sebastian.schoennenbeck@comma-soft.com>
parent 41491913
...@@ -548,7 +548,7 @@ class ChatCompletionRequest(OpenAIBaseModel): ...@@ -548,7 +548,7 @@ class ChatCompletionRequest(OpenAIBaseModel):
if top_logprobs < 0: if top_logprobs < 0:
raise ValueError("`top_logprobs` must be a positive value.") 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( raise ValueError(
"when using `top_logprobs`, `logprobs` must be set to true." "when using `top_logprobs`, `logprobs` must be set to true."
) )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment