From cec3d8768198830012a8857a04aca568d4d9e0e0 Mon Sep 17 00:00:00 2001 From: Corrado De Bari Date: Tue, 19 Nov 2024 10:44:05 +0100 Subject: [PATCH] Fix in check embedding model in startup (#45) * top_p/check_hybrid * check embed model fails at startup --- .gitignore | 4 ++++ app/src/modules/st_common.py | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 6fbdeca..adc6f37 100644 --- a/.gitignore +++ b/.gitignore @@ -39,3 +39,7 @@ spring_ai/create_user.sql spring_ai/drop.sql start.sh spring_ai/env.sh +temp/rag_agent.ipynb +temp/tools.ipynb +temp/tools.py +temp/json-dual.sql diff --git a/app/src/modules/st_common.py b/app/src/modules/st_common.py index c3540bc..b668043 100644 --- a/app/src/modules/st_common.py +++ b/app/src/modules/st_common.py @@ -437,8 +437,13 @@ def create_zip(state_dict_filt, provider): def check_hybrid_conf(session_state_json): chatModel = state.ll_model_config.get(session_state_json["ll_model"]) - embModel = state.embed_model_config.get(state.rag_params["model"]) + if "rag_params" in state and "model" in state.rag_params: + embModel = state.embed_model_config.get(state.rag_params["model"]) + else: + # Handle the case where rag_params or "model" key does not exist + embModel = None # or some default value + logger.info("Model: %s",session_state_json["ll_model"]) logger.info("Embedding Model embModel: %s",embModel) logger.info("Chat Model: %s",chatModel)