mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-08 05:39:13 +00:00
Fix Packaging the Khoj Desktop Apps (#289)
* Add langchain static files and pytorch metadata to Khoj native app * Add pillow static files, metadata & hidden imports to Khoj native app * Fix path to web interface static files on Khoj native app * Add tiktoken hidden imports to make chat work from Khoj native app * Fix Khoj native app to run with GUI mode enabled This got broken when we moved from using the --no-gui flag to using --gui in https://github.com/khoj-ai/khoj/pull/263
This commit is contained in:
10
Khoj.spec
10
Khoj.spec
@@ -5,9 +5,12 @@ from PyInstaller.utils.hooks import copy_metadata
|
|||||||
import sysconfig
|
import sysconfig
|
||||||
|
|
||||||
datas = [
|
datas = [
|
||||||
('src/khoj/interface/web', 'src/khoj/interface/web'),
|
('src/khoj/interface/web', 'khoj/interface/web'),
|
||||||
(f'{sysconfig.get_paths()["purelib"]}/transformers', 'transformers')
|
(f'{sysconfig.get_paths()["purelib"]}/transformers', 'transformers'),
|
||||||
|
(f'{sysconfig.get_paths()["purelib"]}/langchain', 'langchain'),
|
||||||
|
(f'{sysconfig.get_paths()["purelib"]}/PIL', 'PIL')
|
||||||
]
|
]
|
||||||
|
datas += copy_metadata('torch')
|
||||||
datas += copy_metadata('tqdm')
|
datas += copy_metadata('tqdm')
|
||||||
datas += copy_metadata('regex')
|
datas += copy_metadata('regex')
|
||||||
datas += copy_metadata('requests')
|
datas += copy_metadata('requests')
|
||||||
@@ -15,6 +18,7 @@ datas += copy_metadata('packaging')
|
|||||||
datas += copy_metadata('filelock')
|
datas += copy_metadata('filelock')
|
||||||
datas += copy_metadata('numpy')
|
datas += copy_metadata('numpy')
|
||||||
datas += copy_metadata('tokenizers')
|
datas += copy_metadata('tokenizers')
|
||||||
|
datas += copy_metadata('pillow')
|
||||||
|
|
||||||
block_cipher = None
|
block_cipher = None
|
||||||
|
|
||||||
@@ -23,7 +27,7 @@ a = Analysis(
|
|||||||
pathex=[],
|
pathex=[],
|
||||||
binaries=[],
|
binaries=[],
|
||||||
datas=datas,
|
datas=datas,
|
||||||
hiddenimports=['huggingface_hub.repository'],
|
hiddenimports=['huggingface_hub.repository', 'PIL', 'PIL._tkinter_finder', 'tiktoken_ext', 'tiktoken_ext.openai_public'],
|
||||||
hookspath=[],
|
hookspath=[],
|
||||||
hooksconfig={},
|
hooksconfig={},
|
||||||
runtime_hooks=[],
|
runtime_hooks=[],
|
||||||
|
|||||||
@@ -172,5 +172,10 @@ class ServerThread(QThread):
|
|||||||
start_server(self.app, self.host, self.port, self.socket)
|
start_server(self.app, self.host, self.port, self.socket)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
def run_gui():
|
||||||
|
sys.argv += ["--gui"]
|
||||||
run()
|
run()
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
run_gui()
|
||||||
|
|||||||
Reference in New Issue
Block a user