From 16c226e2bb90868bd6d3815f8da04fa9c8c6f47e Mon Sep 17 00:00:00 2001 From: Jon Fairbanks Date: Thu, 4 Jul 2024 18:02:03 -0700 Subject: [PATCH] Remove unnecessary system prompt This can be set in the Ollama LLM but is not used by Llama-Index. --- components/tabs/settings.py | 10 +++++----- utils/ollama.py | 4 +++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/components/tabs/settings.py b/components/tabs/settings.py index 1bcff6a..ce9b79b 100644 --- a/components/tabs/settings.py +++ b/components/tabs/settings.py @@ -39,11 +39,11 @@ def settings(): value=st.session_state["top_k"], key="top_k", ) - st.text_area( - "System Prompt", - value=st.session_state["system_prompt"], - key="system_prompt", - ) + # st.text_area( + # "System Prompt", + # value=st.session_state["system_prompt"], + # key="system_prompt", + # ) st.selectbox( "Chat Mode", ( diff --git a/utils/ollama.py b/utils/ollama.py index 9a789a2..ed71dc6 100644 --- a/utils/ollama.py +++ b/utils/ollama.py @@ -90,6 +90,7 @@ def get_models(): logs.log.error(f"Failed to retrieve Ollama model list: {err}") return [] + ################################### # # Create Ollama LLM instance @@ -111,7 +112,8 @@ def create_ollama_llm(model: str, base_url: str, system_prompt: str = None, requ - llm: An instance of the Ollama language model with the specified configuration. """ try: - Settings.llm = Ollama(model=model, base_url=base_url, system_prompt=system_prompt, request_timeout=request_timeout) + # Settings.llm = Ollama(model=model, base_url=base_url, system_prompt=system_prompt, request_timeout=request_timeout) + Settings.llm = Ollama(model=model, base_url=base_url, request_timeout=request_timeout) logs.log.info("Ollama LLM instance created successfully") return Settings.llm except Exception as e: