mirror of
https://github.com/abetlen/llama-cpp-python.git
synced 2023-09-07 17:34:22 +03:00
Merge pull request #28 from SagsMug/local-lib
Allow local llama library usage
This commit is contained in:
@@ -25,6 +25,12 @@ def _load_shared_library(lib_base_name):
|
|||||||
_base_path / f"{lib_base_name}{lib_ext}"
|
_base_path / f"{lib_base_name}{lib_ext}"
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if ("LLAMA_CPP_LIB" in os.environ):
|
||||||
|
lib_base_name = os.environ["LLAMA_CPP_LIB"]
|
||||||
|
_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)
|
# Add the library directory to the DLL search path on Windows (if needed)
|
||||||
if sys.platform == "win32" and sys.version_info >= (3, 8):
|
if sys.platform == "win32" and sys.version_info >= (3, 8):
|
||||||
os.add_dll_directory(str(_base_path))
|
os.add_dll_directory(str(_base_path))
|
||||||
|
|||||||
Reference in New Issue
Block a user