File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change
1
+ # How to use this file
2
+ #
3
+ # 1. create a folder called "hooks" in your repo
4
+ # 2. copy this file there
5
+ # 3. add the --additional-hooks-dir flag to your pyinstaller command:
6
+ # ex: `pyinstaller --name binary-name --additional-hooks-dir=./hooks entry-point.py`
7
+
8
+
9
+ from PyInstaller .utils .hooks import collect_data_files , get_package_paths
10
+ import os
11
+
12
+ # Get the package path
13
+ package_path = get_package_paths ('llama_cpp' )[0 ]
14
+
15
+ # Collect data files
16
+ datas = collect_data_files ('llama_cpp' )
17
+
18
+ # Append the additional .dll or .so file
19
+ if os .name == 'nt' : # Windows
20
+ dll_path = os .path .join (package_path , 'llama_cpp' , 'llama.dll' )
21
+ datas .append ((dll_path , 'llama_cpp' ))
22
+ elif os .name == 'posix' : # Linux/Mac
23
+ so_path = os .path .join (package_path , 'llama_cpp' , 'llama.so' )
24
+ datas .append ((so_path , 'llama_cpp' ))
You can’t perform that action at this time.
0 commit comments