File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -18,16 +18,16 @@ def _load_shared_library(lib_base_name):
1818
1919 # Construct the paths to the possible shared library names
2020 _base_path = pathlib .Path (__file__ ).parent .resolve ()
21- _local_path = pathlib .Path .cwd ()
2221 # Searching for the library in the current directory under the name "libllama" (default name
2322 # for llamacpp) and "llama" (default name for this repo)
2423 _lib_paths = [
25- _local_path / f"./lib{ lib_base_name } { lib_ext } " ,
26- _local_path / f"./{ lib_base_name } { lib_ext } " ,
2724 _base_path / f"lib{ lib_base_name } { lib_ext } " ,
2825 _base_path / f"{ lib_base_name } { lib_ext } "
2926 ]
3027
28+ if ("LLAMA_LIB" in os .environ ):
29+ _lib_paths = [pathlib .Path (os .environ ["LLAMA_LIB" ]).resolve ()]
30+
3131 # Add the library directory to the DLL search path on Windows (if needed)
3232 if sys .platform == "win32" and sys .version_info >= (3 , 8 ):
3333 os .add_dll_directory (str (_base_path ))
You can’t perform that action at this time.
0 commit comments