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

本地知识库web方式正常,api方式出错 #4363

Open
lettergod opened this issue Jun 30, 2024 · 4 comments
Open

本地知识库web方式正常,api方式出错 #4363

lettergod opened this issue Jun 30, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@lettergod
Copy link

安装6月30日最新版本
Xinference
qwen1.5-chat+bge-large-zh-v1.5

Langchain-Chatchat
chatchat-config model --default_llm_model qwen1.5-chat

Langchain-Chatchat
web方式与LLM对话正常
web方式与本地知识库正常

https://github.com/chatchat-space/Langchain-Chatchat/blob/dev/docs/contributing/api.md
用此api运行
纯 LLM 对话正常
知识库对话错误
运行
base_url = "http://127.0.0.1:7861/chat"
data = {
"messages": [
{"role": "user", "content": "如何提问以获得高质量答案"},
],
"model": "qwen1.5-chat",
"tool_choice": "search_local_knowledgebase",
"extra_body": {"tool_input": {"database": "zb", "query": "如何提问以获得高质量答案"}},
"stream": True,
}

import requests
response = requests.post(f"{base_url}/chat/completions", json=data, stream=True)
for line in response.iter_content(None, decode_unicode=True):
print(line)
返回信息:

data: {"id": "chataef2cc4b-bb97-48e6-b325-17062ea15880", "object": "chat.completion.chunk", "model": "glm4-chat", "created": 1719732663, "status": 1, "message_type": 1, "message_id": null, "is_ref": false, "choices": [{"delta": {"content": "", "tool_calls": []}, "role": "assistant"}]}

data: {"id": "chata865e33e-18e0-487e-8224-d8293028717a", "object": "chat.completion.chunk", "model": "glm4-chat", "created": 1719732663, "status": 8, "message_type": 1, "message_id": null, "is_ref": false, "choices": [{"delta": {"content": "peer closed connection without sending complete message body (incomplete chunked read)", "tool_calls": []}, "role": "assistant"}]}

Langchain-Chatchat提示信息:
httpx.RemoteProtocolError: peer closed connection without sending complete message body (incomplete chunked read)
2024-06-30 07:42:51,744 root 2476 ERROR RemoteProtocolError: Caught exception: peer closed connection without sending complete message body (incomplete chunked read)

Xinference提示信息:
2024-06-30 07:42:51,734 xinference.api.restful_api 1498 ERROR [address=0.0.0.0:46897, pid=1536] Model not found in the model list, uid: glm4-chat
Traceback (most recent call last):
File "/root/anaconda3/envs/xf/lib/python3.11/site-packages/xinference/api/restful_api.py", line 1459, in create_chat_completion
model = await (await self._get_supervisor_ref()).get_model(model_uid)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
......................
File "/root/anaconda3/envs/xf/lib/python3.11/site-packages/xinference/core/supervisor.py", line 968, in get_model
raise ValueError(f"Model not found in the model list, uid: {model_uid}")
^^^^^^^^^^^^^^^^^
ValueError: [address=0.0.0.0:46897, pid=1536] Model not found in the model list, uid: glm4-chat

如果在Xinference中运行多个模型,在纯 LLM 对话api 更换"model": "qwen1.5-chat",比如"model": "glm4-chat",没有问题。

是不是"知识库对话的api“传递过程中,传错"model"这个参数了啊

@lettergod lettergod added the bug Something isn't working label Jun 30, 2024
@lettergod
Copy link
Author

api写的是"model": "qwen1.5-chat",
到Xinference提示的是 Model not found in the model list, uid: glm4-chat

@BaoxingZhang
Copy link

BaoxingZhang commented Jul 1, 2024

我也遇到这个报错了,可以使用[/chat/chat/completions]兼容 openai 的统一 chat 接口,这个是没有问题。

单纯的/chat/chat接口没有找到在哪里赋值的glm4-chat这个值。我有检查这四个地方:
1、--default_llm_model 有检查
2、--set_model_platforms 有检查
3、model_providers.yaml 有检查
4、workspace_config.json 有检查

均不是glm4-chat,但是调用的时候就是使用的glm4-chat

@etveritas
Copy link

是不是版本的问题啊

@fengzengfly
Copy link

same problem

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

4 participants