Skip to content

Commit

Permalink
fix: get models failed (#625)
Browse files Browse the repository at this point in the history
  • Loading branch information
vansangpfiev authored May 29, 2024
1 parent 3914778 commit 739d544
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions cortex-cpp/controllers/server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,8 @@ void server::ModelStatus(

void server::GetModels(const HttpRequestPtr& req,
std::function<void(const HttpResponsePtr&)>&& callback) {
auto engine_type =
(*(req->getJsonObject())).get("engine", kLlamaEngine).asString();
if (!IsEngineLoaded(engine_type)) {
// TODO(sang) need to change this when we support Tensorrt-llm
if (!IsEngineLoaded(kLlamaEngine)) {
Json::Value res;
res["message"] = "Engine is not loaded yet";
auto resp = cortex_utils::nitroHttpJsonResponse(res);
Expand All @@ -155,7 +154,7 @@ void server::GetModels(const HttpRequestPtr& req,
}

LOG_TRACE << "Start to get models";
auto& en = std::get<EngineI*>(engines_[engine_type].engine);
auto& en = std::get<EngineI*>(engines_[kLlamaEngine].engine);
if (en->IsSupported("GetModels")) {
en->GetModels(
req->getJsonObject(),
Expand Down

0 comments on commit 739d544

Please sign in to comment.