Skip to content

server : fix off-by-1 in server_tokens::size_up_to_pos()#20279

Merged
ggerganov merged 2 commits intomasterfrom
gg/server-fix-obo
Mar 9, 2026
Merged

server : fix off-by-1 in server_tokens::size_up_to_pos()#20279
ggerganov merged 2 commits intomasterfrom
gg/server-fix-obo

Conversation

@ggerganov
Copy link
Member

fix #20087 (comment)

n_past should reflect the number of tokens with position strictly smaller than the next position pos_next.

@ggerganov ggerganov requested a review from ngxson as a code owner March 9, 2026 08:36
@ggerganov ggerganov requested a review from aldehir March 9, 2026 08:37
Copy link
Contributor

@aldehir aldehir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Appears to fix the issue, I can't seem to reproduce it anymore. Thanks!

@ggerganov ggerganov merged commit d6e1556 into master Mar 9, 2026
1 check passed
@ggerganov ggerganov deleted the gg/server-fix-obo branch March 9, 2026 14:43
bartowski1182 pushed a commit to bartowski1182/llama.cpp that referenced this pull request Mar 10, 2026
)

* server : fix off-by-1 in server_tokens::size_up_to_pos()

* cont : fix typo [no ci]
Ethan-a2 pushed a commit to Ethan-a2/llama.cpp that referenced this pull request Mar 20, 2026
)

* server : fix off-by-1 in server_tokens::size_up_to_pos()

* cont : fix typo [no ci]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants