From fbf9d0dd03d45a04ec0c9bd9b711a13d35fdc1ec Mon Sep 17 00:00:00 2001 From: Jason Date: Tue, 10 Sep 2024 12:36:49 -0400 Subject: [PATCH] Revise to pass make check/test --- private_gpt/ui/ui.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/private_gpt/ui/ui.py b/private_gpt/ui/ui.py index 1e3804ad4..04258ac39 100644 --- a/private_gpt/ui/ui.py +++ b/private_gpt/ui/ui.py @@ -98,11 +98,12 @@ def __init__( self._selected_filename = None - self._default_mode = settings().ui.default_mode # Initialize system prompt based on default mode - self.mode = self._default_mode - self._system_prompt = self._get_default_system_prompt(self.mode) - + default_mode_map = {mode.value: mode for mode in Modes} + self._default_mode = default_mode_map.get( + settings().ui.default_mode, Modes.RAG_MODE + ) + self._system_prompt = self._get_default_system_prompt(self._default_mode) def _chat( self, message: str, history: list[list[str]], mode: Modes, *_: Any