Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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