mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-03 21:29:08 +00:00
Regenerate embeddings everytime user clicks configure in Desktop GUI
Previously if the embeddings were already there only the khoj.yml config file would get updated. The embeddings would remain old. 1. This results in a stale app state where the config doesn't match the embeddings 2. Currently the user cannot update their config from the config screen. They'd have to use a combination of config screen and web interface>regenerate button to trigger it or delete their ~/.khoj dir This commit should resolve the above issues
This commit is contained in:
@@ -29,6 +29,11 @@ class MainWindow(QtWidgets.QMainWindow):
|
||||
def __init__(self, config_file: Path):
|
||||
super(MainWindow, self).__init__()
|
||||
self.config_file = config_file
|
||||
# Set regenerate flag to regenerate embeddings everytime user clicks configure
|
||||
if state.cli_args:
|
||||
state.cli_args += ['--regenerate']
|
||||
else:
|
||||
state.cli_args = ['--regenerate']
|
||||
|
||||
# Load config from existing config, if exists, else load from default config
|
||||
if resolve_absolute_path(self.config_file).exists():
|
||||
|
||||
Reference in New Issue
Block a user