2023-06-23 21:18:47 +00:00
|
|
|
import site
|
|
|
|
import os
|
|
|
|
from PyInstaller.__main__ import run as pyi_run
|
|
|
|
|
2023-06-23 22:38:22 +00:00
|
|
|
# the llama_cpp directory is not included if not explicitly added
|
2023-06-23 21:18:47 +00:00
|
|
|
site_packages_dir = site.getsitepackages()[0]
|
|
|
|
llama_cpp_dir = os.path.join(site_packages_dir, "llama_cpp")
|
|
|
|
|
|
|
|
args = [
|
2023-06-26 19:57:13 +00:00
|
|
|
"ollama.py",
|
2023-06-23 21:18:47 +00:00
|
|
|
"--paths",
|
|
|
|
site_packages_dir,
|
|
|
|
"--add-data",
|
2023-06-27 18:33:49 +00:00
|
|
|
f"{llama_cpp_dir}{os.pathsep}llama_cpp"
|
2023-06-23 21:18:47 +00:00
|
|
|
]
|
|
|
|
|
2023-06-23 22:38:22 +00:00
|
|
|
# generate the .spec file and run PyInstaller
|
2023-06-23 21:18:47 +00:00
|
|
|
pyi_run(args)
|