Skip to content

Commit ee459f4

Browse files
authored
server : fix --threads-http arg (#7801)
1 parent f83351f commit ee459f4

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

common/common.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1414,6 +1414,14 @@ bool gpt_params_find_arg(int argc, char ** argv, const std::string & arg, gpt_pa
14141414
params.timeout_write = std::stoi(argv[i]);
14151415
return true;
14161416
}
1417+
if (arg == "--threads-http") {
1418+
if (++i >= argc) {
1419+
invalid_param = true;
1420+
return true;
1421+
}
1422+
params.n_threads_http = std::stoi(argv[i]);
1423+
return true;
1424+
}
14171425
if (arg == "-spf" || arg == "--system-prompt-file") {
14181426
if (++i >= argc) {
14191427
invalid_param = true;
@@ -1893,6 +1901,7 @@ void gpt_params_print_usage(int /*argc*/, char ** argv, const gpt_params & param
18931901
options.push_back({ "server", " --ssl-key-file FNAME", "path to file a PEM-encoded SSL private key" });
18941902
options.push_back({ "server", " --ssl-cert-file FNAME", "path to file a PEM-encoded SSL certificate" });
18951903
options.push_back({ "server", " --timeout N", "server read/write timeout in seconds (default: %d)", params.timeout_read });
1904+
options.push_back({ "server", " --threads-http N", "number of threads used to process HTTP requests (default: %d)", params.n_threads_http });
18961905
options.push_back({ "server", " --system-prompt-file FNAME",
18971906
"set a file to load a system prompt (initial prompt of all slots), this is useful for chat applications" });
18981907
options.push_back({ "server", " --log-format {text,json}",

common/common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ struct gpt_params {
184184
int32_t port = 8080; // server listens on this network port
185185
int32_t timeout_read = 600; // http read timeout in seconds
186186
int32_t timeout_write = timeout_read; // http write timeout in seconds
187-
int32_t n_threads_http = -1; // number of threads to use for http server (-1 = use n_threads)
187+
int32_t n_threads_http = -1; // number of threads to process HTTP requests
188188

189189
std::string hostname = "127.0.0.1";
190190
std::string public_path = "";

0 commit comments

Comments
 (0)