From ee71ce8ab73edd07f4c136208d1871e512123f56 Mon Sep 17 00:00:00 2001 From: Mug <> Date: Mon, 10 Apr 2023 17:12:25 +0200 Subject: [PATCH] Make windows users happy (hopefully) --- llama_cpp/llama_cpp.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/llama_cpp/llama_cpp.py b/llama_cpp/llama_cpp.py index de37ff9..0c0581f 100644 --- a/llama_cpp/llama_cpp.py +++ b/llama_cpp/llama_cpp.py @@ -27,7 +27,9 @@ def _load_shared_library(lib_base_name): if ("LLAMA_LIB" in os.environ): lib_base_name = os.environ["LLAMA_LIB"] - _lib_paths = [pathlib.Path(os.environ["LLAMA_LIB"]).resolve()] + _lib = pathlib.Path(lib_base_name) + _base_path = _lib.parent.resolve() + _lib_paths = [_lib.resolve()] # Add the library directory to the DLL search path on Windows (if needed) if sys.platform == "win32" and sys.version_info >= (3, 8):