mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-05 13:21:18 +00:00
Extract configure and routers from main.py into separate modules
- Main.py was becoming too big to manage. It had both controllers/routers and component configurations (search, processors) in it - Now that the native app GUI code is also getting added to the main path, good time to split/modularize/clean main.py - Put global state into a separate file to share across modules
This commit is contained in:
@@ -1 +1,19 @@
|
||||
empty_escape_sequences = r'\n|\r\t '
|
||||
# External Packages
|
||||
import torch
|
||||
from pathlib import Path
|
||||
|
||||
# Internal Packages
|
||||
from src.utils.config import SearchModels, ProcessorConfigModel
|
||||
from src.utils.rawconfig import FullConfig
|
||||
|
||||
# Application Global State
|
||||
config = FullConfig()
|
||||
model = SearchModels()
|
||||
processor_config = ProcessorConfigModel()
|
||||
config_file: Path = ""
|
||||
verbose: int = 0
|
||||
device = torch.device("cuda:0") if torch.cuda.is_available() else torch.device("cpu") # Set device to GPU if available
|
||||
|
||||
# Other Constants
|
||||
web_directory = Path(__file__).parent.parent / 'interface/web/'
|
||||
empty_escape_sequences = r'\n|\r\t '
|
||||
|
||||
Reference in New Issue
Block a user