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

[Bug] InternLM 模型重复回答 & 后端 json 解析持续报错 #37

Closed
crazysteeaam opened this issue Jan 18, 2024 · 1 comment · Fixed by #41
Closed

[Bug] InternLM 模型重复回答 & 后端 json 解析持续报错 #37

crazysteeaam opened this issue Jan 18, 2024 · 1 comment · Fixed by #41

Comments

@crazysteeaam
Copy link

crazysteeaam commented Jan 18, 2024

环境:使用lmdeploy internlm 部署
教程基本一致

反馈两个bug:

  1. 前端一次请求,但后端死循环持续请求模型API,没有跳出循环,只能手动停止。
image

问题一初步判断是 InternLM 模型返回结果是 "finish_reason": null,因此永远不会进入这个分支。
openaoe/backend/service/service_internlm.py

if choice['finish_reason']:
    stop_flag = True

OpenAI API 返回的是 "finish_reason": stop,就可以正常跳出。

  1. 后端 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 JiaYingLii linked a pull request Jan 19, 2024 that will close this issue
6 tasks
@JiaYingLii
Copy link
Collaborator

Thanks for your post, we add a retry times parameter to limit the forever retry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants