From 9e5d501e833ce1341900fe803e9d0f962417eaad Mon Sep 17 00:00:00 2001 From: KevinHuSh Date: Fri, 17 May 2024 14:33:19 +0800 Subject: [PATCH] fix data init error (#820) ### What problem does this PR solve? #810 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- api/db/init_data.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/db/init_data.py b/api/db/init_data.py index fca73077395..458e4ba257d 100644 --- a/api/db/init_data.py +++ b/api/db/init_data.py @@ -391,9 +391,9 @@ def init_llm_factory(): TenantLLMService.filter_update([TenantLLMService.model.llm_factory == "QAnything"], {"llm_factory": "Youdao"}) ## insert openai two embedding models to the current openai user. print("Start to insert 2 OpenAI embedding models...") - tenant_ids = set([row.tenant_id for row in TenantLLMService.get_openai_models()]) + tenant_ids = set([row["tenant_id"] for row in TenantLLMService.get_openai_models()]) for tid in tenant_ids: - for row in TenantLLMService.get_openai_models(llm_factory="OpenAI", tenant_id=tid): + for row in TenantLLMService.query(llm_factory="OpenAI", tenant_id=tid): row = row.to_dict() row["model_type"] = LLMType.EMBEDDING.value row["llm_name"] = "text-embedding-3-small"