Unverified Commit 2d5f5b30 authored by Li Zhang's avatar Li Zhang Committed by GitHub
Browse files

fix out of bounds access (#809)

parent fddad305
......@@ -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) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment