From 5344b11590ad00bb823ef826e8d09655762b52e1 Mon Sep 17 00:00:00 2001 From: tikikun Date: Tue, 14 Nov 2023 14:14:16 +0700 Subject: [PATCH] hotfix: model_loaded status --- controllers/llamaCPP.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/controllers/llamaCPP.cc b/controllers/llamaCPP.cc index 19c3b30d4..63710b466 100644 --- a/controllers/llamaCPP.cc +++ b/controllers/llamaCPP.cc @@ -219,8 +219,13 @@ void llamaCPP::modelStatus( const HttpRequestPtr &req, std::function &&callback) { Json::Value jsonResp; - jsonResp["model_loaded"] = this->model_loaded.load(); - jsonResp["model_data"] = llama.get_model_props().dump(); + bool is_model_loaded = this->model_loaded; + if (is_model_loaded) { + jsonResp["model_loaded"] = is_model_loaded; + jsonResp["model_data"] = llama.get_model_props().dump(); + } else { + jsonResp["model_loaded"] = is_model_loaded; + } auto resp = nitro_utils::nitroHttpJsonResponse(jsonResp); callback(resp);