diff --git a/engine/commands/cmd_info.cc b/engine/commands/cmd_info.cc index 3d419906d..bf13c6bc7 100644 --- a/engine/commands/cmd_info.cc +++ b/engine/commands/cmd_info.cc @@ -27,8 +27,8 @@ CmdInfo::CmdInfo(std::string model_id) { void CmdInfo::Parse(std::string model_id) { if (model_id.find(kDelimiter) == std::string::npos) { - engine = "cortex.llamacpp"; - name = std::move(model_id); + engine_name = "cortex.llamacpp"; + model_name = std::move(model_id); branch = "main"; } else { auto res = split(model_id, kDelimiter); @@ -36,16 +36,16 @@ void CmdInfo::Parse(std::string model_id) { LOG_ERROR << "model_id does not valid"; return; } else { - name = std::move(res[0]); + model_name = std::move(res[0]); branch = std::move(res[1]); if (branch.find("onnx") != std::string::npos) { - engine = "cortex.onnx"; + engine_name = "cortex.onnx"; } else if (branch.find("tensorrt") != std::string::npos) { - engine = "cortex.tensorrt-llm"; + engine_name = "cortex.tensorrt-llm"; } else if (branch.find("gguf") != std::string::npos) { - engine = "cortex.llamacpp"; + engine_name = "cortex.llamacpp"; } else { - LOG_ERROR << "Not a valid branch name " << branch; + LOG_ERROR << "Not a valid branch model_name " << branch; } } } diff --git a/engine/commands/cmd_info.h b/engine/commands/cmd_info.h index d952c3085..460990757 100644 --- a/engine/commands/cmd_info.h +++ b/engine/commands/cmd_info.h @@ -4,8 +4,8 @@ namespace commands { struct CmdInfo { explicit CmdInfo(std::string model_id); - std::string engine; - std::string name; + std::string engine_name; + std::string model_name; std::string branch; private: diff --git a/engine/commands/run_cmd.cc b/engine/commands/run_cmd.cc index 8ec608eb8..1c7e5c7e6 100644 --- a/engine/commands/run_cmd.cc +++ b/engine/commands/run_cmd.cc @@ -18,12 +18,12 @@ void RunCmd::Exec() { auto address = host_ + ":" + std::to_string(port_); CmdInfo ci(model_id_); std::string model_file = - ci.branch == "main" ? ci.name : ci.name + "-" + ci.branch; + ci.branch == "main" ? ci.model_name : ci.model_name + "-" + ci.branch; // TODO should we clean all resource if something fails? // Check if model existed. If not, download it { if (!IsModelExisted(model_file)) { - ModelPullCmd model_pull_cmd(ci.name, ci.branch); + ModelPullCmd model_pull_cmd(ci.model_name, ci.branch); if (!model_pull_cmd.Exec()) { return; } @@ -32,8 +32,8 @@ void RunCmd::Exec() { // Check if engine existed. If not, download it { - if (!IsEngineExisted(ci.engine)) { - EngineInitCmd eic(ci.engine, ""); + if (!IsEngineExisted(ci.engine_name)) { + EngineInitCmd eic(ci.engine_name, ""); if (!eic.Exec()) return; } diff --git a/engine/controllers/command_line_parser.cc b/engine/controllers/command_line_parser.cc index 88d79f4e7..aa9dae171 100644 --- a/engine/controllers/command_line_parser.cc +++ b/engine/controllers/command_line_parser.cc @@ -71,7 +71,7 @@ bool CommandLineParser::SetupCommand(int argc, char** argv) { model_pull_cmd->callback([&model_id]() { commands::CmdInfo ci(model_id); - commands::ModelPullCmd command(ci.name, ci.branch); + commands::ModelPullCmd command(ci.model_name, ci.branch); command.Exec(); });