-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
The stop parameter in openai API doesn't work since v0.2.5 #1048
Comments
Thanks for reporting this. Could you send a pull request to fix it? |
Fixed in #818. |
@jstzwj Thanks for the fix, happy to see it in next version. |
In the openai_api_server, stop works for non-streaming completions, but not for streaming. The problem is the unwanted stop sequence gets streamed out before stopping. As a result, this breaks LangChain ReAct agents |
@andy-yang-1 does the new PR (#1246) fix this? |
I tested the PR locally and it has the same problem. |
@merrymercy My PR didn't fix the problem, how can we solve it? |
We handle the stop string here https://github.com/andy-yang-1/FastChat/blob/fae4087bbb6f7979b61f2e0c2912d77547a5c659/fastchat/serve/inference.py#L164-L175, |
The problem happens when the previous generate token is the partial beginning of the stop sequence. |
@merrymercy |
Since version v0.2.5, it seems the stop parameter in openai api is directly set
conv.stop_str
, rather than from request.https://github.com/lm-sys/FastChat/blob/v0.2.5/fastchat/serve/api.py#L134
In version v0.2.3, it works when set in the request.
https://github.com/lm-sys/FastChat/blob/v0.2.3/fastchat/serve/api.py#L125
The stop parameter is a key when it works with ReAct in langchain, seems quite important to enable.
The text was updated successfully, but these errors were encountered: