-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
server : simplify logic for empty prompts #5953
Conversation
Just to clarify, the server is supposed to generate something for an empty prompt only if it's passed as a string? For example, passing an empty array as
The docs say:
But I'm not sure how to interpret it, and whether it has something to do with handling an empty prompt. Maybe some clarifications are needed in the README. |
Good point - I opened a PR to try to clarify: #5957 Please review |
Seems fine (except for a typo I mentioned there). However, that PR only explains when On the other hand, maybe it's better to wait until API errors are implemented, then return an error if the inference cannot succeed because of an empty prompt. Just defaulting to empty response is a little bit counter-intuitive, IMHO. |
An empty array does not satisfy the first of the 3 requirements listed, because there isn't a string for first element:
So it should not prefix a BOS token |
Ah, you mean it's not clear that for empty set of tokens, we return an empty response. Yes, this can be clarified better |
ref #5776
Handle BOS-only prompts correctly now: