build.py 434 B

123456789101112131415161718
  1. import site
  2. import os
  3. from PyInstaller.__main__ import run as pyi_run
  4. # the llama_cpp directory is not included if not explicitly added
  5. site_packages_dir = site.getsitepackages()[0]
  6. llama_cpp_dir = os.path.join(site_packages_dir, "llama_cpp")
  7. args = [
  8. "ollama.py",
  9. "--paths",
  10. site_packages_dir,
  11. "--add-data",
  12. f"{llama_cpp_dir}{os.pathsep}llama_cpp"
  13. ]
  14. # generate the .spec file and run PyInstaller
  15. pyi_run(args)