Skip to content

Commit

Permalink
llama+metal: python bindings work
Browse files Browse the repository at this point in the history
`ggml-metal.metal` is now searched for next to the .so/.dylib
by adding ggerganov/llama.cpp#1782 to our
fork.
  • Loading branch information
apage43 committed Jun 9, 2023
1 parent d782f2b commit 99f901a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gpt4all-backend/llama.cpp-mainline
4 changes: 2 additions & 2 deletions gpt4all-bindings/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def copy_prebuilt_C_lib(src_dir, dest_dir, dest_build_dir):
d = os.path.join(dest_dir, item)
shutil.copy2(s, d)
files_copied += 1
if item.endswith(lib_ext):
if item.endswith(lib_ext) or item.endswith('.metal'):
s = os.path.join(dirpath, item)
d = os.path.join(dest_build_dir, item)
shutil.copy2(s, d)
Expand Down Expand Up @@ -88,4 +88,4 @@ def copy_prebuilt_C_lib(src_dir, dest_dir, dest_build_dir):
},
package_data={'llmodel': [os.path.join(DEST_CLIB_DIRECTORY, "*")]},
include_package_data=True
)
)
1 change: 1 addition & 0 deletions gpt4all-chat/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ if(METAL_SHADER_FILE)
set_target_properties(chat PROPERTIES
RESOURCE ${METAL_SHADER_FILE}
)
configure_file(${METAL_SHADER_FILE} bin/ggml-metal.metal COPYONLY)
endif()

target_compile_definitions(chat
Expand Down

0 comments on commit 99f901a

Please sign in to comment.