Skip to content
Snippets Groups Projects
Unverified Commit 03f8b01b authored by KevinHuSh's avatar KevinHuSh Committed by GitHub
Browse files

fix bug for fasetembed (#392)

### What problem does this PR solve?

Issue link:#325

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
parent ad6f0a1c
No related branches found
No related tags found
No related merge requests found
...@@ -58,7 +58,7 @@ def upload(): ...@@ -58,7 +58,7 @@ def upload():
if not e: if not e:
return get_data_error_result( return get_data_error_result(
retmsg="Can't find this knowledgebase!") retmsg="Can't find this knowledgebase!")
if DocumentService.get_doc_count(kb.tenant_id) >= os.environ.get('MAX_FILE_NUM_PER_USER', 8192): if DocumentService.get_doc_count(kb.tenant_id) >= int(os.environ.get('MAX_FILE_NUM_PER_USER', 8192)):
return get_data_error_result( return get_data_error_result(
retmsg="Exceed the maximum file number of a free user!") retmsg="Exceed the maximum file number of a free user!")
......
...@@ -83,7 +83,12 @@ class TenantLLMService(CommonService): ...@@ -83,7 +83,12 @@ class TenantLLMService(CommonService):
llm = LLMService.query(llm_name=llm_name) llm = LLMService.query(llm_name=llm_name)
if llm and llm[0].fid in ["QAnything", "FastEmbed"]: if llm and llm[0].fid in ["QAnything", "FastEmbed"]:
model_config = {"llm_factory": llm[0].fid, "api_key":"", "llm_name": llm_name, "api_base": ""} model_config = {"llm_factory": llm[0].fid, "api_key":"", "llm_name": llm_name, "api_base": ""}
if not model_config: raise LookupError("Model({}) not authorized".format(mdlnm)) if not model_config:
if llm_name == "flag-embedding":
model_config = {"llm_factory": "Tongyi-Qianwen", "api_key": "",
"llm_name": llm_name, "api_base": ""}
else:
raise LookupError("Model({}) not authorized".format(mdlnm))
if llm_type == LLMType.EMBEDDING.value: if llm_type == LLMType.EMBEDDING.value:
if model_config["llm_factory"] not in EmbeddingModel: if model_config["llm_factory"] not in EmbeddingModel:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment