From 12a9b9b8f2602e3eae25ee1e987a387f2ee6f6e9 Mon Sep 17 00:00:00 2001 From: Kevin Hu Date: Fri, 31 May 2024 15:41:12 +0800 Subject: [PATCH] fix chunk modification bug --- api/db/services/llm_service.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/db/services/llm_service.py b/api/db/services/llm_service.py index c484afcc3b..5906927b7b 100644 --- a/api/db/services/llm_service.py +++ b/api/db/services/llm_service.py @@ -82,9 +82,9 @@ def model_instance(cls, tenant_id, llm_type, if model_config: model_config = model_config.to_dict() if not model_config: if llm_type in [LLMType.EMBEDDING, LLMType.RERANK]: - llm = LLMService.query(llm_name=llm_name) + llm = LLMService.query(llm_name=llm_name if llm_name else mdlnm) if llm and llm[0].fid in ["Youdao", "FastEmbed", "BAAI"]: - model_config = {"llm_factory": llm[0].fid, "api_key":"", "llm_name": llm_name, "api_base": ""} + model_config = {"llm_factory": llm[0].fid, "api_key":"", "llm_name": llm_name if llm_name else mdlnm, "api_base": ""} if not model_config: if llm_name == "flag-embedding": model_config = {"llm_factory": "Tongyi-Qianwen", "api_key": "",