Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: 如果输入框里的内容较长,搜索知识库会失败 #1968

Closed
3 tasks done
pikakolendo02 opened this issue Feb 19, 2025 · 3 comments
Closed
3 tasks done
Labels
bug Something isn't working

Comments

@pikakolendo02
Copy link

Issue Checklist

  • I understand that issues are for feedback and problem solving, not for complaining in the comment section, and will provide as much information as possible to help solve the problem.
  • I've looked at pinned issues and searched for existing Open Issues and Closed Issues, no similar issue was found.
  • I've filled in short, clear headings so that developers can quickly identify a rough idea of what to expect when flipping through the list of issues. And not "a suggestion", "stuck", etc.

Platform

Linux

Version

0.9.24

Bug Description

Image

如果输入框中的token达到几千,并且选中知识库,则容易出现下面的问题:

{
  "message": "Error invoking remote method 'knowledge-base:search': Error: 500 status code (no body)"
}

推测是程序给嵌入模型的任务太重了。

Steps To Reproduce

  1. 新建知识库(本地ollama,模型为shaw/dmeta-embedding-zh)并添加文件夹,包含多个文件。
  2. 对话中选择该知识库,提问文本较长(3000token)。
  3. 出错。

Expected Behavior

几十个token的短文本加上“粘贴为文件”的长文本不会造成该错误。
期望几千token的纯文字长文本也不会造成该错误。

Relevant Log Output

Additional Context

No response

@pikakolendo02 pikakolendo02 added the bug Something isn't working label Feb 19, 2025
@GeorgeDong32
Copy link
Contributor

这个与cherry-studio无关,模型本身会有最大输入限制,输入的几千token加上附带的上下文可能会触发限制,需要输入长内容时请手动调整对话附带的上下文数量或者使用qwen-long和gemini等长上下文模型
Screenshot_20250219_142622.jpg

@pikakolendo02
Copy link
Author

pikakolendo02 commented Feb 19, 2025

这个与cherry-studio无关,模型本身会有最大输入限制,输入的几千token加上附带的上下文可能会触发限制,需要输入长内容时请手动调整对话附带的上下文数量或者使用qwen-long和gemini等长上下文模型)

在没有上文(新建对话)的情况下,回答3000token的文本(选择知识库)也会出错。不选择知识库的情况下不会出错。
另外,qwen-long也不行

Image

@pikakolendo02
Copy link
Author

pikakolendo02 commented Feb 19, 2025

这个与cherry-studio无关,模型本身会有最大输入限制,输入的几千token加上附带的上下文可能会触发限制,需要输入长内容时请手动调整对话附带的上下文数量或者使用qwen-long和gemini等长上下文模型

再次尝试了一下,与deepseek的上下文无关,与嵌入模型有关。我用reader-lm-1.5b这个支持超大input的嵌入模型创建了一个知识库,deepseek-r1能够在已有3000token的文本时,调用知识库成功。

建议可以设置一个输入嵌入模型的最大文本量,避免一次性给嵌入模型喂入超过处理能力的文本;如果输入框中的文本超过阈值,提示用户,或者自动分批处理,多次调用嵌入模型。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants