From 3df375e1bd7004c16a52f00bb2dc71e94dcbb314 Mon Sep 17 00:00:00 2001 From: SeongBeomLEE <2712qwer@gmail.com> Date: Mon, 18 Nov 2024 20:26:19 +0900 Subject: [PATCH] [fix] Modify the status of finish_reason if the stream value is False --- examples/server/utils.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/server/utils.hpp b/examples/server/utils.hpp index c47ed3e47a76d..602fdb2d9050d 100644 --- a/examples/server/utils.hpp +++ b/examples/server/utils.hpp @@ -662,8 +662,8 @@ static json oaicompat_completion_params_parse( } static json format_final_response_oaicompat(const json & request, const json & result, const std::string & completion_id, bool streaming = false, bool verbose = false) { - bool stopped_word = result.count("stopped_word") != 0; - bool stopped_eos = json_value(result, "stopped_eos", false); + bool stopped_word = json_value(result, "stopped_word", false); + bool stopped_eos = json_value(result, "stopped_eos", false); int num_tokens_predicted = json_value(result, "tokens_predicted", 0); int num_prompt_tokens = json_value(result, "tokens_evaluated", 0); std::string content = json_value(result, "content", std::string(""));