Langchain-Chatchat
Langchain-Chatchat copied to clipboard
[BUG] 知识问答报错:API通信遇到错误
问题描述 / Problem Description 知识库问答,出现API通信错误,检索条目3变成1条也出错
复现问题的步骤 / Steps to Reproduce
- 执行 '$ python startup.py -a'
- 点击 '知识库问答'
- 输入问题
- 问题出现 / Problem occurs
预期的结果 / Expected Result 能正确检索文档
实际结果 / Actual Result API通信遇到错误:peer closed connection without sending complete message body (incomplete chunked read)
环境信息 / Environment Information
- langchain-ChatGLM 版本/commit 号:0.0.354. fastchat版本:0.2.35
- 是否使用 Docker 部署(是/否):否
- 使用的模型(ChatGLM2-6B / Qwen-7B 等): ChatGLM3-6B
- 使用的 Embedding 模型(moka-ai/m3e-base 等):bge-large-zh-v1.5 @ cuda
- 使用的向量库类型 (faiss / milvus / pg_vector 等): faiss / Vector library used (faiss, milvus, pg_vector, etc.): faiss
- 操作系统及版本 / Operating system and version: Linux-5.15.136-tegra-aarch64-with-glibc2.35
- Python 版本 / Python version:3.10
- 其他相关环境信息 / Other relevant environment information: cuda 12.1
附加信息 / Additional Information 添加与问题相关的任何其他信息 / Add any other information related to the issue. log.txt
针对您遇到的“peer closed connection without sending complete message body (incomplete chunked read)”错误,这通常是因为服务器在完整的消息体被发送或接收之前关闭了连接。以下是一些基于您描述的情况可能的解决方案:
-
检查应用日志:寻找与
RemoteProtocolError
和KeyError
相关的特定错误消息或堆栈跟踪,这可以提供故障发生位置的更多上下文。 -
调整Uvicorn和FastAPI的配置:如果问题与负载大小限制有关,可以通过
--limit-concurrency
和--limit-max-requests
命令行参数或代码中的等效配置来调整这些设置。 -
确保端点正确解析和验证输入数据:特别是对于大文本,使用FastAPI中的Pydantic模型来强制输入验证。
-
优化文本修改逻辑的性能或增加Uvicorn及任何前置反向代理或负载均衡器的超时设置:如果处理超时是一个问题,考虑这些选项。
-
验证所有必需的NLTK资源是否在配置的
NLTK_DATA_PATH
中可用,并在应用代码中优雅地处理缺失资源。
如果这些建议没有解决您的问题,提供更多关于导致此错误的API调用的具体函数或方法的信息将有助于进一步缩小问题的可能原因。
Details
Sources
- [BUG] 简洁阐述问题 / 我经常遇到API通信错误,这是什么原因导致的呢?
- 项目使用时报错API通信遇到错误:对等关闭连接而不发送完整的消息正文(不完整的分块读取),再把openai降级为0.28.1后,项目运行报错,一些其他库和openai库冲突
- 使用知识库问答 问完问题后API通信遇到错误
- [BUG] 用通义千问API模式,LLM对话,返回错误:API通信遇到错误:peer closed connection without sending complete message body (incomplete chunked read)
- [BUG] 报错:peer closed connection without sending complete message body (incomplete chunked read)
- 知识库问答时报API通信遇到错误,进行初始化知识库时报错
- startup.py
- webui_pages/utils.py
- server/utils.py
About Dosu This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.
Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.
To continue the conversation, mention @dosu.
把知识检索结果排序功能禁用掉(USE_RERANKER = False)就不会报这个错了,我看报错日志在排序过程中报错了