starting http server before initializing the model

This commit is contained in:
Behnam M 2024-01-10 00:20:33 -05:00 committed by GitHub
parent d59c119f0e
commit 58ad3c3ad2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2798,7 +2798,9 @@ int main(int argc, char **argv)
{"total_threads", std::thread::hardware_concurrency()}, {"total_threads", std::thread::hardware_concurrency()},
{"system_info", llama_print_system_info()}, {"system_info", llama_print_system_info()},
}); });
httplib::Server svr;
ServerState server_state = LOADING_MODEL; ServerState server_state = LOADING_MODEL;
// load the model // load the model
if (!llama.load_model(params)) if (!llama.load_model(params))
@ -2810,7 +2812,6 @@ int main(int argc, char **argv)
llama.initialize(); llama.initialize();
server_state = READY; server_state = READY;
httplib::Server svr;
// Middleware for API key validation // Middleware for API key validation
auto validate_api_key = [&sparams](const httplib::Request &req, httplib::Response &res) -> bool { auto validate_api_key = [&sparams](const httplib::Request &req, httplib::Response &res) -> bool {