xorbitsai / inference

Replace OpenAI GPT with another LLM in your app by changing a single line of code. Xinference gives you the freedom to use any LLM you need. With Xinference, you're empowered to run inference with any open-source language models, speech recognition models, and multimodal models, whether in the cloud, on-premises, or even on your laptop.
https://inference.readthedocs.io
Apache License 2.0
5.38k stars 436 forks source link

:Error code: 500 - {'detail': "[address=0.0.0.0:37059, pid=3614009] Tool response dicts require a 'name' key indicating the name of the called function!"} #2259

Open zhangjiekui opened 2 months ago

zhangjiekui commented 2 months ago

System Info / 系統信息

v0.15.0

Running Xinference with Docker? / 是否使用 Docker 运行 Xinfernece?

Version info / 版本信息

xinference v0.15.0

The command used to start Xinference / 用以启动 xinference 的命令

nohup xinference-local -H 0.0.0.0 --log-level debug >> /data/xinference/xinfer.log 2>&1 &

Reproduction / 复现过程

就是正常运行升级到v0.15.0前的代码

Expected behavior / 期待表现

期待正常运行

qinxuye commented 2 months ago

请贴下服务端的完整报错。

ChengjieLi28 commented 2 months ago

把你怎么使用tool call的过程贴出来,只给个标题是什么意思? issue请给出完整过程,怎么用tool call的?在哪出现这个报错的?

zhangjiekui commented 2 months ago

错误信息1:

` Who won the super bowl in 2024? In what state is the winning team headquarters located?What is the GDP of that state? <|im_end|> <|im_start|>assistant , generate config: {'max_tokens': 32000, 'temperature': 0.01, 'stream': False, 'stop': ['<|endoftext|>', '<|im_start|>', '<|im_end|>'], 'stop_token_ids': [151643, 151644, 151645]} 2024-09-09 06:16:02,783 vllm.engine.async_llm_engine 3695534 INFO Added request fd5c46c5-6e72-11ef-b0dd-dbbd1831f9dd. 2024-09-09 06:16:02,783 vllm.engine.async_llm_engine 3695534 DEBUG Got new requests! 2024-09-09 06:16:07,780 vllm.engine.metrics 3695534 INFO Avg prompt throughput: 337.4 tokens/s, Avg generation throughput: 5.9 tokens/s, Running: 1 reqs, Swapped: 0 reqs, Pending: 0 reqs, GPU KV cache usage: 1.8%, CPU KV cache usage: 0.0%. 2024-09-09 06:16:08,535 vllm.engine.async_llm_engine 3695534 INFO Finished request fd5c46c5-6e72-11ef-b0dd-dbbd1831f9dd. 2024-09-09 06:16:08,536 xinference.model.llm.utils 3695534 ERROR Can't parse qwen tool call output: {"name": "WEB_SEARCH, "arguments": "{\"query\": \"2024 super bowl winner and team headquarters state and state GDP\"}""}. Error: Expecting ',' delimiter: line 1 column 24 (char 23)

`

错误信息2: ` [request f2e2edc4-6e72-11ef-b0dd-dbbd1831f9dd] Enter chat, args: <xinference.core.model.ModelActor object at 0x7f5a1e5636f0>,[{'content': "Solve/Answer user's questions as best as you can in the language the user asked, prefe...,{'max_tokens': 32000, 'temperature': 0.01, 'tools': <list_iterator object at 0x7f5bb3d0aef0>, 'strea..., kwargs: raw_params={'max_tokens': 32000, 'stream': False, 'temperature': 0.01, 'tools': [{'type': 'function', 'function... 2024-09-09 06:15:45,209 xinference.core.model 3695534 ERROR [request f2e2edc4-6e72-11ef-b0dd-dbbd1831f9dd] Leave chat, error: Tool response dicts require a 'name' key indicating the name of the called function!, elapsed time: 0 s Traceback (most recent call last): File "/root/.virtualenvs/xinfer/lib/python3.10/site-packages/xinference/core/utils.py", line 69, in wrapped ret = await func(*args, kwargs) File "/root/.virtualenvs/xinfer/lib/python3.10/site-packages/xinference/core/model.py", line 570, in chat response = await self._call_wrapper_json( File "/root/.virtualenvs/xinfer/lib/python3.10/site-packages/xinference/core/model.py", line 407, in _call_wrapper_json return await self._call_wrapper("json", fn, *args, *kwargs) File "/root/.virtualenvs/xinfer/lib/python3.10/site-packages/xinference/core/model.py", line 120, in _async_wrapper return await fn(args, kwargs) File "/root/.virtualenvs/xinfer/lib/python3.10/site-packages/xinference/core/model.py", line 416, in _call_wrapper ret = await fn(args, kwargs) File "/root/.virtualenvs/xinfer/lib/python3.10/site-packages/xinference/model/llm/vllm/core.py", line 667, in async_chat full_prompt = self.get_full_context( File "/root/.virtualenvs/xinfer/lib/python3.10/site-packages/xinference/model/llm/utils.py", line 113, in get_full_context return self._build_from_raw_template(messages, chat_template, kwargs) File "/root/.virtualenvs/xinfer/lib/python3.10/site-packages/xinference/model/llm/utils.py", line 87, in _build_from_raw_template rendered = compiled_template.render( File "/root/.virtualenvs/xinfer/lib/python3.10/site-packages/jinja2/environment.py", line 1304, in render self.environment.handle_exception() File "/root/.virtualenvs/xinfer/lib/python3.10/site-packages/jinja2/environment.py", line 939, in handle_exception raise rewrite_traceback_stack(source=source) File "