Skip to content

Commit ff3b380

Browse files
committed
server : fix verbose check
1 parent 0d0dc11 commit ff3b380

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

common/arg.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1961,7 +1961,7 @@ gpt_params_context gpt_params_parser_init(gpt_params & params, llama_example ex,
19611961
}
19621962
));
19631963
add_opt(llama_arg(
1964-
{"-lv", "--verbosity", "--log-verbosity"}, "THOLD",
1964+
{"-lv", "--verbosity", "--log-verbosity"}, "N",
19651965
"Set the verbosity threshold. Messages with a higher verbosity will be ignored.",
19661966
[](gpt_params & params, int value) {
19671967
params.verbosity = value;

examples/server/server.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2304,7 +2304,9 @@ int main(int argc, char ** argv) {
23042304

23052305
gpt_init();
23062306

2307-
const bool verbose = params.verbosity > 0;
2307+
// enabling this will output extra debug information in the HTTP responses from the server
2308+
// see format_final_response_oaicompat()
2309+
const bool verbose = params.verbosity > 9;
23082310

23092311
// struct that contains llama context and inference
23102312
server_context ctx_server;
@@ -2830,7 +2832,7 @@ int main(int argc, char ** argv) {
28302832
if (!stream) {
28312833
ctx_server.receive_cmpl_results(task_ids, [&](const std::vector<server_task_result> & results) {
28322834
// multitask is never support in chat completion, there is only one result
2833-
json result_oai = format_final_response_oaicompat(data, results[0].data, completion_id, verbose);
2835+
json result_oai = format_final_response_oaicompat(data, results[0].data, completion_id, /*.streaming =*/ false, verbose);
28342836
res_ok(res, result_oai);
28352837
}, [&](const json & error_data) {
28362838
res_error(res, error_data);

examples/server/utils.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,7 @@ static json format_final_response_oaicompat(const json & request, const json & r
408408
{"id", completion_id}
409409
};
410410

411+
// extra fields for debugging purposes
411412
if (verbose) {
412413
res["__verbose"] = result;
413414
}

0 commit comments

Comments
 (0)