From e72bb2403f077ab364df9ad776d2362e6e591d59 Mon Sep 17 00:00:00 2001 From: ziadb Date: Wed, 29 Nov 2023 17:24:27 -0500 Subject: [PATCH 1/2] * add --log-disable to disable logging to file in the server example --- examples/server/server.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/examples/server/server.cpp b/examples/server/server.cpp index 50f124b13e849..08fea8add109a 100644 --- a/examples/server/server.cpp +++ b/examples/server/server.cpp @@ -1844,6 +1844,7 @@ static void server_print_usage(const char *argv0, const gpt_params ¶ms, printf(" -spf FNAME, --system-prompt-file FNAME\n"); printf(" Set a file to load a system prompt (initial prompt of all slots), this is useful for chat applications.\n"); printf(" --mmproj MMPROJ_FILE path to a multimodal projector file for LLaVA.\n"); + printf(" --log-disable disables logging to afile.\n"); printf("\n"); } @@ -2198,6 +2199,11 @@ static void server_params_parse(int argc, char **argv, server_params &sparams, } params.mmproj = argv[i]; } + else if (arg == "--log-disable") + { + log_set_target(stdout); + LOG_INFO("logging to file is disabled.", {}); + } else { fprintf(stderr, "error: unknown argument: %s\n", arg.c_str()); From 770fc6123f943449ee9aab7735d3852226b72493 Mon Sep 17 00:00:00 2001 From: ziadb Date: Wed, 29 Nov 2023 17:25:24 -0500 Subject: [PATCH 2/2] * typo fix --- examples/server/server.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/server/server.cpp b/examples/server/server.cpp index 08fea8add109a..e041e957567e4 100644 --- a/examples/server/server.cpp +++ b/examples/server/server.cpp @@ -1844,7 +1844,7 @@ static void server_print_usage(const char *argv0, const gpt_params ¶ms, printf(" -spf FNAME, --system-prompt-file FNAME\n"); printf(" Set a file to load a system prompt (initial prompt of all slots), this is useful for chat applications.\n"); printf(" --mmproj MMPROJ_FILE path to a multimodal projector file for LLaVA.\n"); - printf(" --log-disable disables logging to afile.\n"); + printf(" --log-disable disables logging to a file.\n"); printf("\n"); }