Closed 2277419213 closed 2 months ago
好像找到问题了,不知道是不是最优解决,原因是stop_words是None,那既然None没有办法去循环会出现异常,那就加一个前置判断。 if stop_words: delay_token_num = max([len(x) for x in stop_words]) else: delay_token_num = 0 这样就不报错了。在源码487行的位置
是qwen1.5么?
是qwen1.5么?
7b和14b都这样
按照这个方法解决了issue中提出的问题后,又出现了RuntimeError: probability tensor contains either inf
, nan
or element < 0的报错
按照这个方法解决了issue中提出的问题后,又出现了RuntimeError: probability tensor contains either
inf
,nan
or element < 0的报错
原来你看过我帖子,我补一个解决方案
解决了上述问题之后,好像就没有问题,在postman中或者api接口都可以正常请求 但是过第三方接口,例如ONE API的时候,就会报错 RuntimeError: probability tensor contains either inf, nan or element < 0 查看了931之后,官方也表示,修改了temperature为0后,这个是预期现象,这个问题主@pengbj还是个好人,测出来了,只要小于等于0.5就会出现这个情况 ,转念一想,这个temperature与我何干,不让他小于0.5就好了,于是继续修改/openai_api.py源码,限制温度不要小于0.51 gen_kwargs['temperature'] = request.temperature if gen_kwargs['temperature'] < 0.51: gen_kwargs['temperature'] = 0.51 在源码397行
你好老师,我想问下我在文件目录中修改了参数地址为我qlora微调过后的地址,然后直接跑官方那个api使用程序,但是直接报错 是怎么回是呢
nice,亲测可行
是qwen1.5么?
7b和14b都这样
qwen v1.5不是不支持这个openai_api方法吗?不支持chat方法,用的是transformer的那套接口
是qwen1.5么?
7b和14b都这样
qwen v1.5不是不支持这个openai_api方法吗?不支持chat方法,用的是transformer的那套接口
我也不是很懂,为什么大佬给他挪过来 @jklj077
This issue has been automatically marked as inactive due to lack of recent activity. Should you believe it remains unresolved and warrants attention, kindly leave a comment on this thread.
是否已有关于该错误的issue或讨论? | Is there an existing issue / discussion for this?
该问题是否在FAQ中有解答? | Is there an existing answer for this in FAQ?
当前行为 | Current Behavior
(Qwen) [root@ECS-AIServer2 Qwen]# python openai_api.py Warning: please make sure that you are using the latest codes and checkpoints, especially if you used Qwen-7B before 09.25.2023.请使用最新模型和代码,尤其如果你在9月25日前已经开始使用Qwen-7B,千万注意不要使用错误代码和模型。 The model is automatically converting to fp16 for faster inference. If you want to disable the automatic precision, please manually add bf16/fp16/fp32=True to "AutoModelForCausalLM.from_pretrained". Try importing flash-attention for faster inference... Warning: import flash_attn rotary fail, please install FlashAttention rotary to get higher efficiency https://github.com/Dao-AILab/flash-attention/tree/main/csrc/rotary Warning: import flash_attn rms_norm fail, please install FlashAttention layer_norm to get higher efficiency https://github.com/Dao-AILab/flash-attention/tree/main/csrc/layer_norm Warning: import flash_attn fail, please install FlashAttention to get higher efficiency https://github.com/Dao-AILab/flash-attention Loading checkpoint shards: 100%|███████████████████████████████████████████████████████████████████████████████████████| 15/15 [00:10<00:00, 1.43it/s] INFO: Started server process [9010] INFO: Waiting for application startup. INFO: Application startup complete. INFO: Uvicorn running on http://0.0.0.0:7788 (Press CTRL+C to quit) INFO: 10.10.10.88:5073 - "POST /v1/chat/completions HTTP/1.1" 200 OK ERROR: Exception in ASGI application Traceback (most recent call last): File "/root/anaconda3/envs/Qwen/lib/python3.10/site-packages/sse_starlette/sse.py", line 281, in call await wrap(partial(self.listen_for_disconnect, receive)) File "/root/anaconda3/envs/Qwen/lib/python3.10/site-packages/sse_starlette/sse.py", line 270, in wrap await func() File "/root/anaconda3/envs/Qwen/lib/python3.10/site-packages/sse_starlette/sse.py", line 221, in listen_for_disconnect message = await receive() File "/root/anaconda3/envs/Qwen/lib/python3.10/site-packages/uvicorn/protocols/http/h11_impl.py", line 542, in receive await self.message_event.wait() File "/root/anaconda3/envs/Qwen/lib/python3.10/asyncio/locks.py", line 214, in wait await fut asyncio.exceptions.CancelledError: Cancelled by cancel scope 7f6c701737c0
During handling of the above exception, another exception occurred:
期望行为 | Expected Behavior
No response
复现方法 | Steps To Reproduce
No response
运行环境 | Environment
备注 | Anything else?
查阅过330,330解决方案是提升pydantic版本,以确认pydantic版本是2.6.2,非1.X版本,但是仍然报错。 查阅437,报错好像一致,但是没有看到解决方案,因为CUDA只能是11.7,所以Pytorch只能到2.0.1,我的依赖应该都是最新的,详见[运行环境 | Environment](运行环境 | Environment) 其次通过cli_demo.py和web_demo.py均正常启动,唯独openai_api.py报错,期待得到解决方案,谢谢!