Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit d39b332

Browse files
fix: use engine get env (#1530)
Co-authored-by: vansangpfiev <sang@jan.ai>
1 parent baf75e3 commit d39b332

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

engine/cli/commands/server_start_cmd.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,9 @@ bool ServerStartCmd::Exec(const std::string& host, int port) {
9797
v += g;
9898
}
9999
CTL_INF("LD_LIBRARY_PATH: " << v);
100-
auto data_path = file_manager_utils::GetCortexDataPath();
101-
auto llamacpp_path = data_path / "engines" / "cortex.llamacpp/";
102-
auto trt_path = data_path / "engines" / "cortex.tensorrt-llm/";
100+
auto data_path = file_manager_utils::GetEnginesContainerPath();
101+
auto llamacpp_path = data_path / "cortex.llamacpp/";
102+
auto trt_path = data_path / "cortex.tensorrt-llm/";
103103
auto new_v = trt_path.string() + ":" + llamacpp_path.string() + ":" + v;
104104
setenv(name, new_v.c_str(), true);
105105
CTL_INF("LD_LIBRARY_PATH: " << getenv(name));

engine/services/inference_service.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ InferResult InferenceService::LoadModel(
116116
? getenv("ENGINE_PATH")
117117
: file_manager_utils::GetCortexDataPath().string()) +
118118
get_engine_path(ne);
119+
LOG_INFO << "engine path: " << abs_path;
119120
#if defined(_WIN32)
120121
// TODO(?) If we only allow to load an engine at a time, the logic is simpler.
121122
// We would like to support running multiple engines at the same time. Therefore,

engine/utils/file_manager_utils.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,9 @@ inline std::filesystem::path GetModelsContainerPath() {
252252
}
253253

254254
inline std::filesystem::path GetEnginesContainerPath() {
255-
auto cortex_path = GetCortexDataPath();
255+
auto cortex_path = getenv("ENGINE_PATH")
256+
? std::filesystem::path(getenv("ENGINE_PATH"))
257+
: GetCortexDataPath();
256258
auto engines_container_path = cortex_path / "engines";
257259

258260
if (!std::filesystem::exists(engines_container_path)) {

0 commit comments

Comments
 (0)