-
Notifications
You must be signed in to change notification settings - Fork 12.1k
Adding logprobs to /v1/completions #11344
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm sorry I revoke the approval because CI didn't pass, I will have a look
I may need that logic after all. Edit: yep. |
@ngxson Basically it comes down to defaults. I could insert a conditional that would use the value of
That would restore the expected behavior for Example output:
|
Can you try push that so we can see if CI pass? |
Signed-off-by: Jiri Podivin <[email protected]>
@ngxson Sure, there it is. |
Signed-off-by: Jiri Podivin <[email protected]>
Signed-off-by: Jiri Podivin <[email protected]>
Signed-off-by: Jiri Podivin <[email protected]>
Signed-off-by: Jiri Podivin <[email protected]>
The
/v1/completions
endpoint of the server doesn't respect thelogprobs
argument when called.The original API from OpenAI is deprecated, but the endpoint is still used in lot of examples, and I would assume actual projects as well.
This change will allow the
logprobs
to be treated the same asn_probs
is.In principle, this change would allow for
/completion
endpoint to be called with bothn_probs
andlogprobs
.Potentially, this could cause some confusion in case the user would supply both
n_probs
andlogprobs
in the same call to the API.It would be possible to safeguard against that eventuality, but considering the minimal impact of this behavior and that it is only possible in cases when user deliberately calls API with different parameters, I have decided against it.
This way the PR can stay as a one liner.
Documentation needs no adjustment, because it already links to OpenAI docs, implying that it behaves in essentially the same way.
Old output example:
New output example: