瀏覽代碼

fix QWenSeq2txt bug (#2245)

### What problem does this PR solve?

#2243

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
tags/v0.11.0
Kevin Hu 1 年之前
父節點
當前提交
0fe19f3fbc
No account linked to committer's email address
共有 2 個文件被更改,包括 2 次插入2 次删除
  1. 1
    1
      api/apps/llm_app.py
  2. 1
    1
      rag/llm/sequence2txt_model.py

+ 1
- 1
api/apps/llm_app.py 查看文件

@@ -43,7 +43,7 @@ def set_api_key():
chat_passed, embd_passed, rerank_passed = False, False, False
factory = req["llm_factory"]
msg = ""
for llm in LLMService.query(fid=factory):
for llm in LLMService.query(fid=factory)[:3]:
if not embd_passed and llm.model_type == LLMType.EMBEDDING.value:
mdl = EmbeddingModel[factory](
req["api_key"], llm.llm_name, base_url=req.get("base_url"))

+ 1
- 1
rag/llm/sequence2txt_model.py 查看文件

@@ -71,7 +71,7 @@ class QWenSeq2txt(Base):
ans = ""
if result.status_code == HTTPStatus.OK:
for sentence in result.get_sentence():
ans += str(sentence + '\n')
ans += sentence.text.decode('utf-8') + '\n'
return ans, num_tokens_from_string(ans)

return "**ERROR**: " + result.message, 0

Loading…
取消
儲存