-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathfluid-server.spec
More file actions
124 lines (118 loc) · 3.45 KB
/
fluid-server.spec
File metadata and controls
124 lines (118 loc) · 3.45 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# -*- mode: python ; coding: utf-8 -*-
from PyInstaller.utils.hooks import collect_all
import platform
datas = [('src\\fluid_server', 'fluid_server')]
binaries = []
hiddenimports = [
'uvicorn.logging',
'uvicorn.loops',
'uvicorn.loops.auto',
'uvicorn.protocols',
'uvicorn.protocols.http',
'uvicorn.protocols.http.auto',
'uvicorn.protocols.websockets',
'uvicorn.protocols.websockets.auto',
'uvicorn.lifespan',
'uvicorn.lifespan.on',
'uvicorn.lifespan.off',
'fluid_server.app',
'fluid_server.managers',
'fluid_server.runtimes',
'fluid_server.runtimes.llamacpp_llm',
'fluid_server.runtimes.qnn_whisper',
'fluid_server.runtimes.onnx_llm',
'fluid_server.api',
'fluid_server.models',
'fluid_server.utils',
'fluid_server.utils.platform_utils',
'fluid_server.utils.model_converter',
'librosa',
'scipy',
'scipy.signal',
'scipy.stats',
'scipy.stats._distn_infrastructure',
'scipy.stats._stats',
'scipy.stats.distributions',
'scipy.io',
'scipy.fft',
'numpy',
'soundfile',
'_soundfile_data',
'multiprocessing',
'asyncio',
'llama_cpp',
'llama_cpp.llama_cpp',
'llama_cpp._internals',
]
# Architecture-specific package collection
if platform.machine().lower() in ['x86_64', 'amd64']:
# x64: Only include basic packages, skip OpenVINO collection to avoid torch issues
collect_packages = ['librosa', 'scipy', 'soundfile', 'llama_cpp']
hiddenimports.extend([
'openvino',
'openvino_genai',
'openvino_tokenizers',
'openvino.runtime',
'openvino.properties',
])
# Explicitly collect openvino_tokenizers to include DLLs
tmp_ret = collect_all('openvino_tokenizers')
datas += tmp_ret[0]
binaries += tmp_ret[1]
hiddenimports += tmp_ret[2]
elif platform.machine().lower() in ['arm64', 'aarch64']:
# ARM64: Include ARM-specific packages
collect_packages = ['librosa', 'scipy', 'soundfile', 'llama_cpp', 'whisper', 'onnxruntime']
hiddenimports.extend([
'onnxruntime',
'onnxruntime.capi',
'onnxruntime.providers',
'whisper',
'whisper.decoding',
'whisper.audio',
'whisper.tokenizer',
])
else:
# Default: basic packages only
collect_packages = ['librosa', 'scipy', 'soundfile', 'llama_cpp']
# Collect packages normally
for pkg in collect_packages:
tmp_ret = collect_all(pkg)
datas += tmp_ret[0]
binaries += tmp_ret[1]
hiddenimports += tmp_ret[2]
a = Analysis(
['src\\fluid_server\\__main__.py'],
pathex=[],
binaries=binaries,
datas=datas,
hiddenimports=hiddenimports,
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=['openvino.torch', 'openvino.frontend.pytorch'] + (['onnxruntime', 'whisper'] if platform.machine().lower() in ['x86_64', 'amd64'] else []),
noarchive=False,
optimize=0,
)
pyz = PYZ(a.pure)
exe = EXE(
pyz,
a.scripts,
a.binaries,
a.datas,
[],
name='fluid-server',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=False, # Disable UPX for ARM64 compatibility
upx_exclude=[],
runtime_tmpdir=None,
console=False,
disable_windowed_traceback=False,
argv_emulation=False,
# target_arch can be set to 'arm64' or 'x86_64' if needed
# By default, PyInstaller builds for the host architecture
codesign_identity=None,
entitlements_file=None,
)