FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
llama-cpp-python/scripts/hook-llama_cpp.py at main · earonesty/llama-cpp-python · GitHub
earonesty
/
llama-cpp-python
Public
forked from
abetlen/llama-cpp-python
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
1
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
llama-cpp-python
/
scripts
/
hook-llama_cpp.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
27 lines (22 loc) · 959 Bytes
Breadcrumbs
llama-cpp-python
/
scripts
/
hook-llama_cpp.py
Copy path
File metadata and controls
27 lines (22 loc) · 959 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# How to use this file
#
# 1. create a folder called "hooks" in your repo
# 2. copy this file there
# 3. add the --additional-hooks-dir flag to your pyinstaller command:
# ex: `pyinstaller --name binary-name --additional-hooks-dir=./hooks entry-point.py`
from
PyInstaller
.
utils
.
hooks
import
collect_data_files
,
get_package_paths
import
os
,
sys
# Get the package path
package_path
=
get_package_paths
(
'llama_cpp'
)[
0
]
# Collect data files
datas
=
collect_data_files
(
'llama_cpp'
)
# Append the additional .dll or .so file
if
os
.
name
==
'nt'
:
# Windows
dll_path
=
os
.
path
.
join
(
package_path
,
'llama_cpp'
,
'llama.dll'
)
datas
.
append
((
dll_path
,
'llama_cpp'
))
elif
sys
.
platform
==
'darwin'
:
# Mac
so_path
=
os
.
path
.
join
(
package_path
,
'llama_cpp'
,
'llama.dylib'
)
datas
.
append
((
so_path
,
'llama_cpp'
))
elif
os
.
name
==
'posix'
:
# Linux
so_path
=
os
.
path
.
join
(
package_path
,
'llama_cpp'
,
'libllama.so'
)
datas
.
append
((
so_path
,
'llama_cpp'
))
Back
|
FazBrowse Home
|
New Git URL