mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-27 17:35:07 +01:00
Delete plaintext config via API. Catch any offline model loading exception
This commit is contained in:
parent
53abd1a506
commit
6631fc38db
3 changed files with 6 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
|||
import { App, Notice, PluginSettingTab, request, Setting, TFile } from 'obsidian';
|
||||
import { App, Notice, PluginSettingTab, Setting, TFile } from 'obsidian';
|
||||
import Khoj from 'src/main';
|
||||
import { updateContentIndex } from './utils';
|
||||
|
||||
|
|
|
@ -186,6 +186,10 @@ if not state.demo:
|
|||
state.content_index.markdown = None
|
||||
elif content_type == "org":
|
||||
state.content_index.org = None
|
||||
elif content_type == "plaintext":
|
||||
state.content_index.plaintext = None
|
||||
else:
|
||||
logger.warning(f"Request to delete unknown content type: {content_type} via API")
|
||||
|
||||
try:
|
||||
save_config_to_file_updated_state()
|
||||
|
|
|
@ -106,7 +106,7 @@ class ConversationProcessorConfigModel:
|
|||
if self.offline_chat.enable_offline_chat:
|
||||
try:
|
||||
self.gpt4all_model.loaded_model = download_model(self.offline_chat.chat_model)
|
||||
except ValueError as e:
|
||||
except Exception as e:
|
||||
self.offline_chat.enable_offline_chat = False
|
||||
self.gpt4all_model.loaded_model = None
|
||||
logger.error(f"Error while loading offline chat model: {e}", exc_info=True)
|
||||
|
|
Loading…
Reference in a new issue