mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-07 13:23:15 +00:00
Store args passed from commandline at app start in global app state
This commit is contained in:
@@ -11,7 +11,7 @@ from PyQt6.QtCore import QThread
|
|||||||
# Internal Packages
|
# Internal Packages
|
||||||
from src.configure import configure_server
|
from src.configure import configure_server
|
||||||
from src.router import router
|
from src.router import router
|
||||||
from src.utils import constants
|
from src.utils import constants, state
|
||||||
from src.utils.cli import cli
|
from src.utils.cli import cli
|
||||||
from src.interface.desktop.configure_screen import ConfigureScreen
|
from src.interface.desktop.configure_screen import ConfigureScreen
|
||||||
from src.interface.desktop.system_tray import create_system_tray
|
from src.interface.desktop.system_tray import create_system_tray
|
||||||
@@ -25,7 +25,8 @@ app.include_router(router)
|
|||||||
|
|
||||||
def run():
|
def run():
|
||||||
# Load config from CLI
|
# Load config from CLI
|
||||||
args = cli(sys.argv[1:])
|
state.cli_args = sys.argv[1:]
|
||||||
|
args = cli(state.cli_args)
|
||||||
|
|
||||||
# Setup Base GUI
|
# Setup Base GUI
|
||||||
gui = QtWidgets.QApplication([])
|
gui = QtWidgets.QApplication([])
|
||||||
|
|||||||
@@ -12,4 +12,5 @@ model = SearchModels()
|
|||||||
processor_config = ProcessorConfigModel()
|
processor_config = ProcessorConfigModel()
|
||||||
config_file: Path = ""
|
config_file: Path = ""
|
||||||
verbose: int = 0
|
verbose: int = 0
|
||||||
device = torch.device("cuda:0") if torch.cuda.is_available() else torch.device("cpu") # Set device to GPU if available
|
device = torch.device("cuda:0") if torch.cuda.is_available() else torch.device("cpu") # Set device to GPU if available
|
||||||
|
cli_args = None
|
||||||
Reference in New Issue
Block a user