File tree Expand file tree Collapse file tree 3 files changed +31
-29
lines changed Expand file tree Collapse file tree 3 files changed +31
-29
lines changed Original file line number Diff line number Diff line change 81
81
run : |
82
82
python -m pytest
83
83
84
- # build-linux-opencl:
85
-
86
- # runs-on: ubuntu-latest
87
-
88
- # steps:
89
- # - uses: actions/checkout@v4
90
- # with:
91
- # submodules: "recursive"
92
- # - name: Set up Python 3.8
93
- # uses: actions/setup-python@v5
94
- # with:
95
- # python-version: "3.8"
96
- # - name: Set up OpenCL & CLBlast
97
- # run: |
98
- # wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null
99
- # echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
100
- # sudo apt-get update
101
- # sudo apt-get install -y --no-install-recommends llvm intel-oneapi-runtime-opencl intel-oneapi-runtime-compilers libclblast-dev
102
- # - name: Install dependencies
103
- # run: |
104
- # python -m pip install --upgrade pip
105
- # CMAKE_ARGS="-DLLAMA_CLBLAST=on" python -m pip install .[all] --verbose
106
- # - name: Test with pytest
107
- # run: |
108
- # python -m pytest
109
-
110
84
111
85
build-macos-metal :
112
86
Original file line number Diff line number Diff line change @@ -72,11 +72,24 @@ if (LLAMA_BUILD)
72
72
add_subdirectory (vendor/llama.cpp )
73
73
llama_cpp_python_install_target (llama )
74
74
llama_cpp_python_install_target (ggml )
75
+
75
76
# Workaround for Windows + CUDA https://github.com/abetlen/llama-cpp-python/issues/563
76
- if (WIN32 AND ( LLAMA_CUDA OR LLAMA_CUBLAS ) )
77
+ if (WIN32 )
77
78
install (
78
79
FILES $< TARGET_RUNTIME_DLLS:llama>
79
- DESTINATION ${LLAMA_CPP_PYTHON_INSTALL_DIR}
80
+ DESTINATION ${CMAKE_CURRENT_SOURCE_DIR} /llama_cpp/lib
81
+ )
82
+ install (
83
+ FILES $< TARGET_RUNTIME_DLLS:llama>
84
+ DESTINATION ${SKBUILD_PLATLIB_DIR} /llama_cpp/lib
85
+ )
86
+ install (
87
+ FILES $< TARGET_RUNTIME_DLLS:ggml>
88
+ DESTINATION ${CMAKE_CURRENT_SOURCE_DIR} /llama_cpp/lib
89
+ )
90
+ install (
91
+ FILES $< TARGET_RUNTIME_DLLS:ggml>
92
+ DESTINATION ${SKBUILD_PLATLIB_DIR} /llama_cpp/lib
80
93
)
81
94
endif ()
82
95
@@ -98,5 +111,15 @@ if (LLAMA_BUILD)
98
111
set_target_properties (llava_shared PROPERTIES CUDA_ARCHITECTURES OFF )
99
112
endif ()
100
113
llama_cpp_python_install_target (llava_shared )
114
+ if (WIN32 )
115
+ install (
116
+ FILES $< TARGET_RUNTIME_DLLS:llava_shared>
117
+ DESTINATION ${CMAKE_CURRENT_SOURCE_DIR} /llama_cpp/lib
118
+ )
119
+ install (
120
+ FILES $< TARGET_RUNTIME_DLLS:llava_shared>
121
+ DESTINATION ${SKBUILD_PLATLIB_DIR} /llama_cpp/lib
122
+ )
123
+ endif ()
101
124
endif ()
102
- endif ()
125
+ endif ()
Original file line number Diff line number Diff line change @@ -52,7 +52,12 @@ def _load_shared_library(lib_base_name: str):
52
52
_lib_paths = [_lib .resolve ()]
53
53
54
54
cdll_args = dict () # type: ignore
55
+
55
56
# Add the library directory to the DLL search path on Windows (if needed)
57
+ if sys .platform == "win32" :
58
+ os .add_dll_directory (str (_base_path ))
59
+ os .environ ['PATH' ] = str (_base_path ) + os .pathsep + os .environ ['PATH' ]
60
+
56
61
if sys .platform == "win32" and sys .version_info >= (3 , 8 ):
57
62
os .add_dll_directory (str (_base_path ))
58
63
if "CUDA_PATH" in os .environ :
You can’t perform that action at this time.
0 commit comments