Skip to content

Refactoring: Use STL in input processing and fix off-by-one bug #115

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed

Conversation

thomasantony
Copy link

There was an off-by-one bug in the line

if (embd.size() > params.n_batch) {
    break;
}

it would copy n_batch+1 elements rather than n_batch. This PR fixes that and also switches to using STL instead of a while loop

@thomasantony thomasantony force-pushed the refactor_input_processing branch from faacdb5 to 68897eb Compare March 14, 2023 05:07
ggerganov added a commit that referenced this pull request Mar 19, 2023
@ggerganov
Copy link
Member

Thanks for spotting this!
For now I prefer to keep the loop-based implementation - I find it easier to read.
Pushed the off-by-one fix to master

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants