mirror of
https://github.com/khoj-ai/khoj.git
synced 2025-02-17 08:04:21 +00:00
Reduce Windows App Size by Removing Unused Libraries under Torch/Lib
Tighten the duplicate library removal code in Khoj.spec
This commit is contained in:
parent
b78ee317ae
commit
082fe937b9
1 changed files with 8 additions and 9 deletions
17
Khoj.spec
17
Khoj.spec
|
@ -32,15 +32,14 @@ a = Analysis(
|
|||
noarchive=False,
|
||||
)
|
||||
|
||||
# Filter out unused, duplicate shared libs under torch/lib
|
||||
torch_lib_path = set([
|
||||
join('torch', 'lib', 'libtorch_cuda.so'),
|
||||
join('torch', 'lib', 'libtorch_cuda.dylib'),
|
||||
join('torch', 'lib', 'libtorch_cpu.so'),
|
||||
join('torch', 'lib', 'libtorch_cpu.dylib'),
|
||||
join('torch', 'lib', 'libtorch_python.so'),
|
||||
join('torch', 'lib', 'libtorch_python.dylib')])
|
||||
a.datas = [entry for entry in a.datas if not entry[0] in torch_lib_path]
|
||||
# Filter out unused, duplicate shared libs
|
||||
extension = {'Windows': '.dll', 'Darwin': '.dylib', 'Linux': '.so'}[system()]
|
||||
torch_lib_paths = {
|
||||
join('torch', 'lib', 'libtorch_cuda' + extension),
|
||||
join('torch', 'lib', 'libtorch_cpu' + extension),
|
||||
join('torch', 'lib', 'libtorch_python' + extension)
|
||||
}
|
||||
a.datas = [entry for entry in a.datas if not entry[0] in torch_lib_paths]
|
||||
|
||||
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue