From ec29b8ad9f701b8399b7bc0e4f0c710cf8143fd8 Mon Sep 17 00:00:00 2001 From: thxCode Date: Thu, 18 Jul 2024 15:00:11 +0800 Subject: [PATCH] fix: health Signed-off-by: thxCode --- llama-box/main.cpp | 4 ++++ llama-box/tools/completion.sh | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/llama-box/main.cpp b/llama-box/main.cpp index f3d883b..4110764 100644 --- a/llama-box/main.cpp +++ b/llama-box/main.cpp @@ -2592,14 +2592,18 @@ int main(int argc, char **argv) { // load the model if (!ctx_server.load_model(bparams)) { + state.store(SERVER_STATE_ERROR); return 1; } LOG_INFO("model loaded", {}); + // init server if (!ctx_server.init()) { + state.store(SERVER_STATE_ERROR); return 1; } LOG_INFO("server initialized", {}); + state.store(SERVER_STATE_READY); // if a custom chat template is not supplied, we will use the one that comes // with the model (if any) diff --git a/llama-box/tools/completion.sh b/llama-box/tools/completion.sh index 99282c5..6df2ac6 100755 --- a/llama-box/tools/completion.sh +++ b/llama-box/tools/completion.sh @@ -140,7 +140,7 @@ echo "SEED : ${SEED}" printf "=====================================================\n\n" if [[ -f "${LOG_FILE}" ]]; then - rm -f "${LOG_FILE}" + : > "${LOG_FILE}" fi if [[ ! -f "${LOG_FILE}" ]]; then touch "${LOG_FILE}"