We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 13dca2a commit a89f75eCopy full SHA for a89f75e
examples/server/utils.hpp
@@ -360,9 +360,9 @@ static json oaicompat_completion_params_parse(
360
361
// Handle "logprobs" field
362
// 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")) {
+ if (json_value(body, "logprobs", false)) {
364
llama_params["n_probs"] = json_value(body, "top_logprobs", 20);
365
- } else if (body.contains("top_logprobs")) {
+ } else if (body.contains("top_logprobs") && !body.at("top_logprobs").is_null()) {
366
throw std::runtime_error("top_logprobs requires logprobs to be set to true");
367
}
368
0 commit comments