Skip to content

fixed off by one error when context shifting in main.cpp example #6921

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 1, 2024

Conversation

l3utterfly
Copy link
Contributor

Is this an error? During my tests, eval throws an error below if n_past + embd.size() == nctx, so we need to start shifting one token earlier

@cebtenzzre cebtenzzre requested a review from ggerganov May 1, 2024 15:21
Copy link
Member

@ggerganov ggerganov left a comment

Choose a reason for hiding this comment

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

Yes, seems like an error

@ggerganov ggerganov merged commit 8d608a8 into ggml-org:master May 1, 2024
@HanClinto
Copy link
Collaborator

As they say, "There are only two hard problems in computer science."

  • Naming things
  • Cache invalidation
  • Off-by-one errors

@l3utterfly l3utterfly deleted the off-by-one-ctx-main branch May 2, 2024 13:41
nopperl pushed a commit to nopperl/llama.cpp that referenced this pull request May 5, 2024
teleprint-me pushed a commit to teleprint-me/llama.cpp that referenced this pull request May 7, 2024
scottmudge pushed a commit to scottmudge/koboldcpp that referenced this pull request May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants