Skip to content

Commit

Permalink
fix out of bounds access (#809)
Browse files Browse the repository at this point in the history
  • Loading branch information
lzhangzz authored Dec 7, 2023
1 parent fddad30 commit 2d5f5b3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/turbomind/models/llama/LlamaBatch.cc
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ void LlamaBatch<T>::Initialize(GenerationState& g)
// check if the last sequence is partial
int partial = 0;
int partial_len = -1;
{
if (state_->active_size) {
const int i = state_->active_size - 1;
partial = state_->sequences[i]->cache_len + state_->sequences[i]->input_length != state_->h_context_length[i];
if (partial) {
Expand Down

0 comments on commit 2d5f5b3

Please sign in to comment.