This repository was archived by the owner on Jul 4, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -19,12 +19,15 @@ constexpr static auto kOnnxEngine = "cortex.onnx";
1919constexpr static auto kTensorrtLlmEngine = " cortex.tensorrt-llm" ;
2020} // namespace
2121
22- server::server (){
23-
24- // Some default values for now below
25- // log_disable(); // Disable the log to file feature, reduce bloat for
26- // target
27- // system ()
22+ server::server () {
23+
24+ // Some default values for now below
25+ // log_disable(); // Disable the log to file feature, reduce bloat for
26+ // target
27+ // system ()
28+ #if defined(WIN32)
29+ SetDefaultDllDirectories (LOAD_LIBRARY_SEARCH_DEFAULT_DIRS);
30+ #endif
2831};
2932
3033server::~server () {}
@@ -292,6 +295,12 @@ void server::LoadModel(const HttpRequestPtr& req,
292295 (getenv (" ENGINE_PATH" ) ? getenv (" ENGINE_PATH" )
293296 : cortex_utils::GetCurrentPath ()) +
294297 get_engine_path (engine_type);
298+ #if defined(WIN32)
299+ auto ws = std::wstring (abs_path.begin (), abs_path.end ());
300+ if (AddDllDirectory (ws.c_str ()) == 0 ) {
301+ LOG_WARN << " Could not add dll directory: " << abs_path;
302+ }
303+ #endif
295304 engines_[engine_type].dl =
296305 std::make_unique<cortex_cpp::dylib>(abs_path, " engine" );
297306
You can’t perform that action at this time.
0 commit comments