Commit graph

5 commits

Author SHA1 Message Date
Debanjum Singh Solanky
082fe937b9 Reduce Windows App Size by Removing Unused Libraries under Torch/Lib
Tighten the duplicate library removal code in Khoj.spec
2022-08-18 11:28:28 +03:00
Debanjum Singh Solanky
7cf345a138 Exclude unused mac libs under torch/lib. Reduce Mac app size by 30Mb
libtorch_cuda only seems to be imported in Linux. Which is why the
size of the Mac, Windows apps are 700Mb smaller than the Debian app size.

Guessing this is because libtorch_cuda only works on Linux machines?

Anyway, removing libtorch_{cpu,python}.dylib under torch/lib from the
Mac app reduces it's size from 190Mb to 160Mb. 15% reduction isn't too bad
2022-08-17 22:59:01 +03:00
Debanjum Singh Solanky
0273be0232 Exclude unused libs under torch/lib. Reduce Debian package size by 700Mb
- libtorch_cuda.so (1Gb) and libtorch_cpu.so (700Mb) are large shared
  libs that are available at package root and under torch/lib.
- The top level imports are used, so they unused libs are removed from
  package
- This reduces the single file package size from 1.6Gb to 920Mb
2022-08-17 22:32:58 +03:00
Debanjum Singh Solanky
a10a2ea3ad Run job matrix to wrap Khoj into app installers for Debian, Windows too 2022-08-14 03:39:45 +03:00
Debanjum Singh Solanky
e5691f9d1d PyInstaller Spec to Wrap Khoj into a Basic Native App
- Verified functionality on MacOS

- Add ICNS Icon to use as MacOS App Icon
- Spec generated by PyInstaller:
  ```sh
  pyinstaller \
       src/main.py \
       --windowed \
       --onefile \
       --name "Khoj" \
       --target-arch arm64 \
       -i src/interface/web/assets/icons/favicon.icns \
       --add-data "src/interface/web:src/interface/web" \
       --copy-metadata tqdm \
       --copy-metadata regex \
       --copy-metadata requests \
       --copy-metadata packaging \
       --copy-metadata filelock \
       --copy-metadata numpy \
       --copy-metadata tokenizers
  ```
2022-08-08 23:23:02 +03:00