Skip to content

server : do not return error when running out of context (with ctx shift disabled) #13577

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

Merged
merged 1 commit into from
May 16, 2025

Conversation

ngxson
Copy link
Collaborator

@ngxson ngxson commented May 15, 2025

Currently, when context shifting is disabled, we trigger the line of code that is not supposed to be called:

if (!params_base.ctx_shift) {
    // this check is redundant (for good)
    // we should never get here, because generation should already stopped in process_token()
    slot.release();
    send_error(slot, "context shift is disabled", ERROR_TYPE_SERVER);
    continue;
}

This returns an error, which makes downstream applications unhappy.

NOTE: some variables may need to be renamed after #13576

@ngxson ngxson requested a review from ggerganov May 15, 2025 22:34
@github-actions github-actions bot added examples python python script changes server labels May 15, 2025
@ngxson ngxson merged commit 6aa892e into ggml-org:master May 16, 2025
46 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
examples python python script changes server
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants