-
Notifications
You must be signed in to change notification settings - Fork 59
Expand file tree
/
Copy pathdashai.spec
More file actions
83 lines (76 loc) · 2.66 KB
/
Copy pathdashai.spec
File metadata and controls
83 lines (76 loc) · 2.66 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
import os
import platform
import site
from PyInstaller.utils.hooks import collect_all
SITEPKG = str(site.getsitepackages()[-1])
# Check for llama_cpp/lib presence to determine if we can include the binaries
llama_lib = os.path.exists(os.path.join(SITEPKG, "llama_cpp/lib"))
if platform.system() == "Darwin":
webview_datas, webview_binaries, webview_hiddenimports = collect_all('webview')
else:
webview_datas, webview_binaries, webview_hiddenimports = [], [], []
# Ensure the temp_checkpoints directory exists before building
if not os.path.exists(os.path.join("DashAI/back/user_models/temp_checkpoints")):
os.makedirs("DashAI/back/user_models/temp_checkpoints")
a = Analysis(
platform.system() == "Windows" and ["DashAI/__main__.py"] or ["DashAI/webview.py"],
pathex=["."],
binaries=(llama_lib and [(f"{SITEPKG}/llama_cpp/lib/*", "llama_cpp/lib")] or []) + webview_binaries,
datas=[
("DashAI/__main__.py", "DashAI/__main__.py"),
("DashAI/alembic", "DashAI/alembic"),
("DashAI/front/build", "DashAI/front/build"),
("DashAI/back/static/images", "DashAI/back/static/images"),
("DashAI/back/types/inf/ptype/LR.sav", "DashAI/back/types/inf/ptype"),
("DashAI/back/types/inf/ptype/scaler.pkl", "DashAI/back/types/inf/ptype"),
(
"DashAI/back/user_models/temp_checkpoints",
"DashAI/back/user_models/temp_checkpoints",
),
("DashAI/back/seeds", "DashAI/back/seeds"),
(f"{SITEPKG}/transformers", "transformers"),
# Ship source .py for packages that run torch.jit.script at import time.
# PyInstaller bundles only .pyc, but TorchScript needs original source
# via inspect.getsource, so these must be shipped as data dirs.
(f"{SITEPKG}/diffusers", "diffusers"),
(f"{SITEPKG}/controlnet_aux", "controlnet_aux"),
] + webview_datas,
hiddenimports=webview_hiddenimports,
hookspath=["hooks"],
runtime_hooks=None,
excludes=None,
)
pyz = PYZ(a.pure)
exe = EXE(
pyz,
a.scripts,
exclude_binaries=True,
name="dashAI-launcher-cpu",
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=False,
console=True,
argv_emulation=True,
icon="installer/dashAI.ico",
)
coll = COLLECT(
exe,
a.binaries,
a.datas,
strip=False,
upx=False,
upx_exclude=[],
name="dashAI-launcher-cpu",
)
if platform.system() == "Darwin":
app = BUNDLE(
coll,
name='dashAI.app',
icon='installer/dashAI.icns',
bundle_identifier='com.dashai.app',
info_plist={
'NSHighResolutionCapable': 'True',
'LSBackgroundOnly': 'False',
},
)