build server into desktop app

This commit is contained in:
Jeffrey Morgan
2023-06-25 00:30:02 -04:00
parent 369108e1ad
commit d3709f85b5
10 changed files with 31 additions and 55 deletions

5
server/.gitignore vendored Normal file
View File

@@ -0,0 +1,5 @@
.env
.venv
*.spec
build
dist

View File

@@ -1,6 +1,5 @@
import site
import os
import shutil
from PyInstaller.__main__ import run as pyi_run
# the llama_cpp directory is not included if not explicitly added
@@ -13,10 +12,9 @@ args = [
site_packages_dir,
"--add-data",
f"{llama_cpp_dir}{os.pathsep}llama_cpp",
"--onefile",
"--onefile"
]
# generate the .spec file and run PyInstaller
pyi_run(args)
shutil.copy2("dist/server", "../client/resources/server")

View File

@@ -76,4 +76,4 @@ def generate():
if __name__ == "__main__":
app.run(debug=True, threaded=True, port=5000)
app.run(debug=True, threaded=True, port=5001)