KevinHuSh commited on
Commit
8e8680b
·
1 Parent(s): 6aa5abc

fix data init error (#820)

Browse files

### What problem does this PR solve?

#810

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)

Files changed (1) hide show
  1. api/db/init_data.py +2 -2
api/db/init_data.py CHANGED
@@ -391,9 +391,9 @@ def init_llm_factory():
391
  TenantLLMService.filter_update([TenantLLMService.model.llm_factory == "QAnything"], {"llm_factory": "Youdao"})
392
  ## insert openai two embedding models to the current openai user.
393
  print("Start to insert 2 OpenAI embedding models...")
394
- tenant_ids = set([row.tenant_id for row in TenantLLMService.get_openai_models()])
395
  for tid in tenant_ids:
396
- for row in TenantLLMService.get_openai_models(llm_factory="OpenAI", tenant_id=tid):
397
  row = row.to_dict()
398
  row["model_type"] = LLMType.EMBEDDING.value
399
  row["llm_name"] = "text-embedding-3-small"
 
391
  TenantLLMService.filter_update([TenantLLMService.model.llm_factory == "QAnything"], {"llm_factory": "Youdao"})
392
  ## insert openai two embedding models to the current openai user.
393
  print("Start to insert 2 OpenAI embedding models...")
394
+ tenant_ids = set([row["tenant_id"] for row in TenantLLMService.get_openai_models()])
395
  for tid in tenant_ids:
396
+ for row in TenantLLMService.query(llm_factory="OpenAI", tenant_id=tid):
397
  row = row.to_dict()
398
  row["model_type"] = LLMType.EMBEDDING.value
399
  row["llm_name"] = "text-embedding-3-small"