-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchatbot.spec
More file actions
98 lines (90 loc) · 2.33 KB
/
chatbot.spec
File metadata and controls
98 lines (90 loc) · 2.33 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# -*- mode: python ; coding: utf-8 -*-
import os
from PyInstaller.utils.hooks import collect_data_files, collect_submodules
block_cipher = None
# Enhanced data collection
datas = [
('icons/*.ico', 'icons'), # Only include .ico files
('app/*.py', 'app'), # Include all Python files recursively
('model/*', 'model'), # Include all model files recursively
]
# Collect all pydantic submodules properly
pydantic_submodules = collect_submodules('pydantic')
langchain_core_submodules = collect_submodules('langchain_core')
langchain_ollama_submodules = collect_submodules('langchain_ollama')
# Expanded hidden imports with common dependencies
hidden_imports = [
'pydantic',
'pydantic.deprecated.decorator', # Add the specific missing module
*pydantic_submodules, # Include all pydantic submodules
'langchain_core',
*langchain_core_submodules,
'langchain_ollama',
*langchain_ollama_submodules,
'speech_recognition',
'markdown',
'pygments',
'pygments.lexers.*',
'pygments.formatters.*',
'sqlite3',
'asyncio',
'aiohttp',
'typing_extensions',
]
a = Analysis(
['main.py'],
pathex=[os.path.dirname(os.path.abspath(SPEC))],
binaries=[],
datas=datas,
hiddenimports=hidden_imports,
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[
'matplotlib', 'numpy', 'pandas', 'scipy', 'tkinter',
'PyQt5', 'wx', 'test', '_pytest', # Additional excludes
],
noarchive=False,
optimize=2,
)
# Compress with higher efficiency
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
exe = EXE(
pyz,
a.scripts,
a.binaries,
a.datas,
[],
name='Madick AI Chatbot',
debug=False,
bootloader_ignore_signals=False,
strip=True, # Strip symbols to reduce size
upx=True,
upx_exclude=[
'vcruntime140.dll',
'python*.dll',
],
runtime_tmpdir=None,
console=False,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
icon='icons/favicon.ico',
uac_admin=False,
)
# Optimized collection
coll = COLLECT(
exe,
a.binaries,
a.zipfiles,
a.datas,
strip=True,
upx=True,
upx_exclude=[
'vcruntime140.dll',
'python*.dll',
],
name='Madick AI Chatbot',
)