mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2026-09-04 03:51:17 +02:00
server: (router) lazy-load startup_models after main setup (#27424)
* server: (router) lazy-load startup_models after main setup * only allow is_first_load to populate it * nits * nits 2
This commit is contained in:
@@ -424,6 +424,18 @@ int llama_server(common_params & params, int argc, char ** argv) {
|
||||
ctx_http.stop();
|
||||
};
|
||||
|
||||
try {
|
||||
models_routes->models.load_startup_models();
|
||||
} catch (const std::exception & e) {
|
||||
SRV_ERR("failed to load models on startup: %s\n", e.what());
|
||||
ctx_http.stop();
|
||||
if (ctx_http.thread.joinable()) {
|
||||
ctx_http.thread.join();
|
||||
}
|
||||
clean_up();
|
||||
return 1;
|
||||
}
|
||||
|
||||
} else {
|
||||
// setup clean up function, to be called before exit
|
||||
clean_up = [&ctx_http, &ctx_server, &mcp_mgr]() {
|
||||
|
||||
Reference in New Issue
Block a user