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 c546c94

Browse filesBrowse files
committed
misc: Install shared libraries to lib subdirectory
1 parent bf5e0bb commit c546c94
Copy full SHA for c546c94

File tree

Expand file treeCollapse file tree

3 files changed

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

3 files changed

+6
-4
lines changed

‎CMakeLists.txt

Copy file name to clipboardExpand all lines: CMakeLists.txt
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@ option(LLAVA_BUILD "Build llava shared library and install alongside python pack
88
if(SKBUILD_STATE STREQUAL "editable")
99
# Install into the source directory
1010
# Temporary fix for https://github.com/scikit-build/scikit-build-core/issues/374
11-
set(LLAMA_CPP_PYTHON_INSTALL_DIR ${CMAKE_CURRENT_SOURCE_DIR}/llama_cpp)
11+
set(LLAMA_CPP_PYTHON_INSTALL_DIR ${CMAKE_CURRENT_SOURCE_DIR}/llama_cpp/lib)
1212
else()
13-
set(LLAMA_CPP_PYTHON_INSTALL_DIR ${SKBUILD_PLATLIB_DIR}/llama_cpp)
13+
set(LLAMA_CPP_PYTHON_INSTALL_DIR ${SKBUILD_PLATLIB_DIR}/llama_cpp/lib)
1414
endif()
1515

16+
message(STATUS "LLAMA_CPP_PYTHON_INSTALL_DIR: ${LLAMA_CPP_PYTHON_INSTALL_DIR}")
17+
1618
if (LLAMA_BUILD)
1719
set(BUILD_SHARED_LIBS "On")
1820

‎llama_cpp/llama_cpp.py

Copy file name to clipboardExpand all lines: llama_cpp/llama_cpp.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
# Load the library
2424
def _load_shared_library(lib_base_name: str):
2525
# Construct the paths to the possible shared library names
26-
_base_path = pathlib.Path(os.path.abspath(os.path.dirname(__file__)))
26+
_base_path = pathlib.Path(os.path.abspath(os.path.dirname(__file__))) / "lib"
2727
# Searching for the library in the current directory under the name "libllama" (default name
2828
# for llamacpp) and "llama" (default name for this repo)
2929
_lib_paths: List[pathlib.Path] = []

‎llama_cpp/llava_cpp.py

Copy file name to clipboardExpand all lines: llama_cpp/llava_cpp.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
# Load the library
3636
def _load_shared_library(lib_base_name: str):
3737
# Construct the paths to the possible shared library names
38-
_base_path = pathlib.Path(os.path.abspath(os.path.dirname(__file__)))
38+
_base_path = pathlib.Path(os.path.abspath(os.path.dirname(__file__))) / "lib"
3939
# Searching for the library in the current directory under the name "libllama" (default name
4040
# for llamacpp) and "llama" (default name for this repo)
4141
_lib_paths: List[pathlib.Path] = []

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.