Tuchuanhuhuhu commited on
Commit
3677395
·
1 Parent(s): cbb6284

除了OpenAI模型,默认使用本地embedding

Browse files
Files changed (1) hide show
  1. modules/base_model.py +1 -1
modules/base_model.py CHANGED
@@ -204,7 +204,7 @@ class BaseLLMModel:
204
  index = construct_index(self.api_key, file_src=files)
205
  assert index is not None, "索引构建失败"
206
  msg = "索引构建完成,获取回答中……"
207
- if local_embedding:
208
  embed_model = LangchainEmbedding(HuggingFaceEmbeddings())
209
  else:
210
  embed_model = OpenAIEmbedding()
 
204
  index = construct_index(self.api_key, file_src=files)
205
  assert index is not None, "索引构建失败"
206
  msg = "索引构建完成,获取回答中……"
207
+ if local_embedding or self.model_type != ModelType.OpenAI:
208
  embed_model = LangchainEmbedding(HuggingFaceEmbeddings())
209
  else:
210
  embed_model = OpenAIEmbedding()