Skip to content

Commit

Permalink
fix data init error (infiniflow#820)
Browse files Browse the repository at this point in the history
### What problem does this PR solve?

infiniflow#810 

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
  • Loading branch information
KevinHuSh committed May 17, 2024
1 parent 4ca176b commit 9e5d501
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/db/init_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 9e5d501

Please sign in to comment.