Fix: Revert showing control tokens by default for server OpenAI Chat completions #6860
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In #6807 @ggerganov added the ability to toggle showing control tokens (e.g. EOS tokens). In
common.cpp
this was set totrue
by default in two places, which broke the/v1/chat/completions
endpoint as described in #6859 - in short, the OpenAI chat completions endpoint response now includes the EOS / stop token, which is different from past behavior / expected behavior.I have confirmed that reverting the booleans to be
false
in the two places incommon.cpp
fixes this behavior.While this PR fixes the breaking change, it may affect behavior that is dependent on #6807's new default of
true
in other places. This may need to be investigated further, but I propose reverting the change for now to fix the broken/v1/chat/completions
behavior.s/o @QueryType for opening #6847 as well which was caused by the same underlying issue.
API Response before the change (ChatML model):
API Response before the change (Mistral model / llama2 template):
Correct API response after this change:
(note the absence of control tokens)