Langchain-Chatchat icon indicating copy to clipboard operation
Langchain-Chatchat copied to clipboard

调用agent查询本地知识库报错:APIError: Caught exception: An error occurred during streaming

Open jersonal opened this issue 1 year ago • 1 comments

问题描述 / Problem Description 调用agent查询本地知识库报错: chatchat终端报错信息:

Entering new AgentExecutor chain... INFO: 127.0.0.1:38928 - "POST /v1/chat/completions HTTP/1.1" 200 OK 2024-08-09 09:18:30,390 httpx 22987 INFO HTTP Request: POST http://127.0.0.1:7861/v1/chat/completions "HTTP/1.1 200 OK" 2024-08-09 09:18:30,398 httpx 22987 INFO HTTP Request: POST http://127.0.0.1:9997/v1/chat/completions "HTTP/1.1 200 OK" 2024-08-09 09:18:31.734 | ERROR | chatchat.server.api_server.openai_routes:generator:105 - openai request error: An error occurred during streaming 2024-08-09 09:18:31.758 | ERROR | chatchat.server.utils:wrap_done:46 - APIError: Caught exception: An error occurred during streaming

chatchat 可视化web页面报错信息: 问:大模型在推理过程中有哪些优化显存的策略 答:这个问题涉及到大模型的优化策略,我需要调用一下大模型优化的知识库来回答这个问题。 An error occurred during streaming image

xinference报错信息: 2024-08-09 09:18:31,730 xinference.api.restful_api 11477 ERROR Chat completion stream got an error: [address=0.0.0.0:45209, pid=12401] unhashable type: 'slice' Traceback (most recent call last): File "/home/envs/xinference/lib/python3.10/site-packages/xinference/model/llm/utils.py", line 587, in _to_chat_completion_chunks for i, chunk in enumerate(chunks): File "/home/envs/xinference/lib/python3.10/site-packages/xinference/model/llm/pytorch/chatglm.py", line 497, in _stream_generator chunk_text = chunk_text[last_chunk_text_length:] TypeError: [address=0.0.0.0:45209, pid=12401] unhashable type: 'slice' image image

复现问题的步骤 / Steps to Reproduce

  1. 执行 startup.py
  2. 页面点击启动Agent、显示Agent过程、选择工具为 本地知识库
  3. 对话框输入问题
  4. 回答:这个问题涉及到大模型的优化策略,我需要调用一下大模型优化的知识库来回答这个问题。后报错:An error occurred during streaming

环境信息 / Environment Information

  • Langchain-Chatchat 版本 / commit 号:0.3.1.3
  • 部署方式(pypi 安装 / 源码部署 / docker 部署): dev deployment
  • 使用的模型推理框架(Xinference / Ollama / OpenAI API 等):Xinference
  • 使用的 LLM 模型(GLM-4-9B / Qwen2-7B-Instruct 等):chatglm3
  • 使用的 Embedding 模型(bge-large-zh-v1.5 / m3e-base 等):bge-large-zh-v1.5
  • 使用的向量库类型 (faiss / milvus / pg_vector 等): faiss
  • 操作系统及版本 / Operating system and version: Ubuntu20.04
  • Python 版本 / Python version: 3.10.12
  • 推理使用的硬件(GPU / CPU / MPS / NPU 等) / Inference hardware (GPU / CPU / MPS / NPU, etc.): GPU

jersonal avatar Aug 09 '24 01:08 jersonal

我也是,用的chatglm3 + bge large 也是报错An error occurred during streaming 换成qwen虽然不报错 但不知道为什么卡的不行

zik-iiio avatar Aug 09 '24 07:08 zik-iiio

有解决办法嘛

sy960923 avatar Aug 14 '24 09:08 sy960923

有解决办法嘛 不用transformers换成vllm启动试试

zik-iiio avatar Aug 14 '24 09:08 zik-iiio

这个问题已经被标记为 stale ,因为它已经超过 30 天没有任何活动。

github-actions[bot] avatar Sep 13 '24 21:09 github-actions[bot]

这个问题已经被自动关闭,因为它被标为 stale 后超过 14 天没有任何活动。

github-actions[bot] avatar Sep 27 '24 21:09 github-actions[bot]