Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0460fdb

Browse filesBrowse files
authored
Merge pull request abetlen#28 from SagsMug/local-lib
Allow local llama library usage
2 parents 63d8a3c + 2559e5a commit 0460fdb
Copy full SHA for 0460fdb

File tree

Expand file treeCollapse file tree

1 file changed

+6
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-0
lines changed

‎llama_cpp/llama_cpp.py

Copy file name to clipboardExpand all lines: llama_cpp/llama_cpp.py
+6Lines changed: 6 additions & 0 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.