Skip to content

Commit 347ba4a

Browse files
authored
Update hook-llama_cpp.py
osx seems to use dylib
1 parent 71dbaa2 commit 347ba4a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

scripts/hook-llama_cpp.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88

99
from PyInstaller.utils.hooks import collect_data_files, get_package_paths
10-
import os
10+
import os, sys
1111

1212
# Get the package path
1313
package_path = get_package_paths('llama_cpp')[0]
@@ -19,6 +19,9 @@
1919
if os.name == 'nt': # Windows
2020
dll_path = os.path.join(package_path, 'llama_cpp', 'llama.dll')
2121
datas.append((dll_path, 'llama_cpp'))
22-
elif os.name == 'posix': # Linux/Mac
22+
elif sys.platform == 'darwin': # Mac
23+
so_path = os.path.join(package_path, 'llama_cpp', 'llama.dylib')
24+
datas.append((so_path, 'llama_cpp'))
25+
elif os.name == 'posix': # Linux
2326
so_path = os.path.join(package_path, 'llama_cpp', 'llama.so')
2427
datas.append((so_path, 'llama_cpp'))

0 commit comments

Comments
 (0)