Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit 5b59529

Browse files
authored
Merge pull request #48 from janhq/45-load-model-fail-should-exit-with-code-1-instead-of-continue-serving-http-server
temp: terminate the process when model load failed
2 parents a6c9495 + 7488d10 commit 5b59529

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

controllers/llamaCPP.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#pragma once
22

33
#include "controllers/nitro_utils.h"
4+
#include <drogon/HttpAppFramework.h>
45
#include <drogon/HttpSimpleController.h>
6+
#include <exception>
57
#include <trantor/utils/Logger.h>
68
#include "common.h"
79
#include "llama.h"
@@ -1406,7 +1408,8 @@ class llamaCPP : public drogon::HttpSimpleController<llamaCPP> {
14061408

14071409
// load the model
14081410
if (!llama.loadModel(params)) {
1409-
LOG_ERROR_LLAMA("Strange error","Error loading the model");
1411+
LOG_ERROR_LLAMA("Strange error","Error loading the model will exit the program");
1412+
std::terminate();
14101413
}
14111414
nitro_utils::nitro_logo();
14121415
}

0 commit comments

Comments
 (0)