Skip to content

Commit 077e16f

Browse files
author
Gimling
committed
server: Handle "logprobs" field with false value
1 parent 11ac980 commit 077e16f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/server/utils.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ static json oaicompat_completion_params_parse(
360360

361361
// Handle "logprobs" field
362362
// TODO: The response format of this option is not yet OAI-compatible, but seems like no one really using it; We may need to fix it in the future
363-
if (body.contains("logprobs")) {
363+
if (json_value(body, "logprobs", false)) {
364364
llama_params["n_probs"] = json_value(body, "top_logprobs", 20);
365365
} else if (body.contains("top_logprobs")) {
366366
throw std::runtime_error("top_logprobs requires logprobs to be set to true");

0 commit comments

Comments
 (0)