[Bug] InternLM 模型重复回答 & 后端 json 解析持续报错
crazysteeaam opened this issue · 1 comments
crazysteeaam commented
环境:使用lmdeploy internlm 部署
和教程基本一致
反馈两个bug:
- 前端一次请求,但后端死循环持续请求模型API,没有跳出循环,只能手动停止。
问题一初步判断是 InternLM 模型返回结果是 "finish_reason": null
,因此永远不会进入这个分支。
openaoe/backend/service/service_internlm.py
if choice['finish_reason']:
stop_flag = True
OpenAI API 返回的是 "finish_reason": stop
,就可以正常跳出。
- 后端 json 解析持续报错,同时在疯狂请求模型API
AOE后端命令行:
INFO: 127.0.0.1:50810 - "POST /v1/internlm/v1/chat/completions HTTP/1.1" 200 OK
JSON Parse Error: Expecting value: line 1 column 2 (char 1)
JSON Parse Error: Expecting value: line 1 column 1 (char 0)
JSON Parse Error: Expecting value: line 1 column 2 (char 1)
JSON Parse Error: Expecting value: line 1 column 1 (char 0)
JSON Parse Error: Expecting value: line 1 column 2 (char 1)
JSON Parse Error: Expecting value: line 1 column 1 (char 0)
JSON Parse Error: Expecting value: line 1 column 2 (char 1)
......
模型服务命令行:
INFO: 127.0.0.1:36372 - "POST /v1/chat/completions HTTP/1.1" 200 OK
INFO: 127.0.0.1:36382 - "POST /v1/chat/completions HTTP/1.1" 200 OK
INFO: 127.0.0.1:36394 - "POST /v1/chat/completions HTTP/1.1" 200 OK
INFO: 127.0.0.1:36396 - "POST /v1/chat/completions HTTP/1.1" 200 OK
INFO: 127.0.0.1:36400 - "POST /v1/chat/completions HTTP/1.1" 200 OK
INFO: 127.0.0.1:36406 - "POST /v1/chat/completions HTTP/1.1" 200 OK
INFO: 127.0.0.1:36422 - "POST /v1/chat/completions HTTP/1.1" 200 OK
INFO: 127.0.0.1:36426 - "POST /v1/chat/completions HTTP/1.1" 200 OK
INFO: 127.0.0.1:36428 - "POST /v1/chat/completions HTTP/1.1" 200 OK
INFO: 127.0.0.1:36434 - "POST /v1/chat/completions HTTP/1.1" 200 OK
......
JiaYingLii commented
Thanks for your post, we add a retry times parameter to limit the forever retry.