Skip to content

Commit

Permalink
hotfix: model_loaded status
Browse files Browse the repository at this point in the history
  • Loading branch information
tikikun committed Nov 14, 2023
1 parent d28291e commit 5344b11
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions controllers/llamaCPP.cc
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,13 @@ void llamaCPP::modelStatus(
const HttpRequestPtr &req,
std::function<void(const HttpResponsePtr &)> &&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);
Expand Down

0 comments on commit 5344b11

Please sign in to comment.