Kevin Hu commited on
Commit
8a4c42a
·
1 Parent(s): 2459d65

adapt to lower case cohere (#3392)

Browse files

### What problem does this PR solve?

#3384

### Type of change

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

Files changed (1) hide show
  1. api/db/init_data.py +3 -0
api/db/init_data.py CHANGED
@@ -97,6 +97,8 @@ def init_superuser():
97
  def init_llm_factory():
98
  try:
99
  LLMService.filter_delete([(LLM.fid == "MiniMax" or LLM.fid == "Minimax")])
 
 
100
  except Exception:
101
  pass
102
 
@@ -128,6 +130,7 @@ def init_llm_factory():
128
  LLMFactoriesService.filter_delete([LLMFactoriesService.model.name == "QAnything"])
129
  LLMService.filter_delete([LLMService.model.fid == "QAnything"])
130
  TenantLLMService.filter_update([TenantLLMService.model.llm_factory == "QAnything"], {"llm_factory": "Youdao"})
 
131
  TenantService.filter_update([1 == 1], {
132
  "parser_ids": "naive:General,qa:Q&A,resume:Resume,manual:Manual,table:Table,paper:Paper,book:Book,laws:Laws,presentation:Presentation,picture:Picture,one:One,audio:Audio,knowledge_graph:Knowledge Graph,email:Email"})
133
  ## insert openai two embedding models to the current openai user.
 
97
  def init_llm_factory():
98
  try:
99
  LLMService.filter_delete([(LLM.fid == "MiniMax" or LLM.fid == "Minimax")])
100
+ LLMService.filter_delete([(LLM.fid == "cohere")])
101
+ LLMFactoriesService.filter_delete([LLMFactories.name == "cohere"])
102
  except Exception:
103
  pass
104
 
 
130
  LLMFactoriesService.filter_delete([LLMFactoriesService.model.name == "QAnything"])
131
  LLMService.filter_delete([LLMService.model.fid == "QAnything"])
132
  TenantLLMService.filter_update([TenantLLMService.model.llm_factory == "QAnything"], {"llm_factory": "Youdao"})
133
+ TenantLLMService.filter_update([TenantLLMService.model.llm_factory == "cohere"], {"llm_factory": "Cohere"})
134
  TenantService.filter_update([1 == 1], {
135
  "parser_ids": "naive:General,qa:Q&A,resume:Resume,manual:Manual,table:Table,paper:Paper,book:Book,laws:Laws,presentation:Presentation,picture:Picture,one:One,audio:Audio,knowledge_graph:Knowledge Graph,email:Email"})
136
  ## insert openai two embedding models to the current openai user.