mirror of
https://github.com/ggerganov/llama.cpp.git
synced 2024-11-13 14:29:52 +00:00
server : fix verbose check
This commit is contained in:
parent
0d0dc11185
commit
ff3b3809d8
@ -1961,7 +1961,7 @@ gpt_params_context gpt_params_parser_init(gpt_params & params, llama_example ex,
|
||||
}
|
||||
));
|
||||
add_opt(llama_arg(
|
||||
{"-lv", "--verbosity", "--log-verbosity"}, "THOLD",
|
||||
{"-lv", "--verbosity", "--log-verbosity"}, "N",
|
||||
"Set the verbosity threshold. Messages with a higher verbosity will be ignored.",
|
||||
[](gpt_params & params, int value) {
|
||||
params.verbosity = value;
|
||||
|
@ -2304,7 +2304,9 @@ int main(int argc, char ** argv) {
|
||||
|
||||
gpt_init();
|
||||
|
||||
const bool verbose = params.verbosity > 0;
|
||||
// enabling this will output extra debug information in the HTTP responses from the server
|
||||
// see format_final_response_oaicompat()
|
||||
const bool verbose = params.verbosity > 9;
|
||||
|
||||
// struct that contains llama context and inference
|
||||
server_context ctx_server;
|
||||
@ -2830,7 +2832,7 @@ int main(int argc, char ** argv) {
|
||||
if (!stream) {
|
||||
ctx_server.receive_cmpl_results(task_ids, [&](const std::vector<server_task_result> & results) {
|
||||
// multitask is never support in chat completion, there is only one result
|
||||
json result_oai = format_final_response_oaicompat(data, results[0].data, completion_id, verbose);
|
||||
json result_oai = format_final_response_oaicompat(data, results[0].data, completion_id, /*.streaming =*/ false, verbose);
|
||||
res_ok(res, result_oai);
|
||||
}, [&](const json & error_data) {
|
||||
res_error(res, error_data);
|
||||
|
@ -408,6 +408,7 @@ static json format_final_response_oaicompat(const json & request, const json & r
|
||||
{"id", completion_id}
|
||||
};
|
||||
|
||||
// extra fields for debugging purposes
|
||||
if (verbose) {
|
||||
res["__verbose"] = result;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user