Skip to content

Commit 0460fdb

Browse files
authored
Merge pull request ggml-org#28 from SagsMug/local-lib
Allow local llama library usage
2 parents 63d8a3c + 2559e5a commit 0460fdb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

llama_cpp/llama_cpp.py

+6
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ def _load_shared_library(lib_base_name):
2525
_base_path / f"{lib_base_name}{lib_ext}"
2626
]
2727

28+
if ("LLAMA_CPP_LIB" in os.environ):
29+
lib_base_name = os.environ["LLAMA_CPP_LIB"]
30+
_lib = pathlib.Path(lib_base_name)
31+
_base_path = _lib.parent.resolve()
32+
_lib_paths = [_lib.resolve()]
33+
2834
# Add the library directory to the DLL search path on Windows (if needed)
2935
if sys.platform == "win32" and sys.version_info >= (3, 8):
3036
os.add_dll_directory(str(_base_path))

0 commit comments

Comments
 (0)