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

support "stop" in api chat/completions #3114

Closed
1 task done
davidyao opened this issue Apr 3, 2024 · 2 comments · Fixed by #3527
Closed
1 task done

support "stop" in api chat/completions #3114

davidyao opened this issue Apr 3, 2024 · 2 comments · Fixed by #3527
Labels
solved This problem has been already solved.

Comments

@davidyao
Copy link

davidyao commented Apr 3, 2024

Reminder

  • I have read the README and searched the existing issues.

Reproduction

CUDA_VISIBLE_DEVICES=0
USE_MODELSCOPE_HUB=1
API_PORT=7860
python src/api_demo.py
--model_name_or_path qwen/Qwen-72B-Chat-Int4
--template qwen

Expected behavior

openai的chat completion 接口支持 stop指令,可以用来做 early stop。 但是现在的接口好像不支持。希望能支持一下以减少不必要的推理

image

System Info

No response

Others

No response

@hiyouga hiyouga added the pending This problem is yet to be addressed. label Apr 3, 2024
@JieShenAI
Copy link

"do_sample": false,
  "temperature": 0.0,
  "top_p": 0,
  "n": 1,
  "max_tokens": 128,
  "stream": false,
  "stop": "<|endoftext|>"

我在API 请求中,设置了 stop, 也是没有生效;直到达到了模型生成的最大长度后,才停止生成。

@hiyouga
Copy link
Owner

hiyouga commented Apr 12, 2024

@JieShenAI 还没支持。

@hiyouga hiyouga added solved This problem has been already solved. and removed pending This problem is yet to be addressed. labels May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
solved This problem has been already solved.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants