Skip to content

Commit 12a3f8b

Browse files
committed
Properly assign the initialised logits tracking (although nothing seems to be done with them atm)
1 parent 78601ec commit 12a3f8b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

llama-cpp-2/src/llama_batch.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,13 @@ impl LlamaBatch {
123123
self.llama_batch.n_seq_id.add(j).write(1);
124124

125125
let write_logits = logits_all || i == n_tokens - 1;
126-
self.llama_batch.logits.add(j).write(write_logits as i8)
126+
self.llama_batch.logits.add(j).write(write_logits as i8);
127+
if write_logits {
128+
self.initialized_logits.push(j as i32);
129+
}
127130
}
128131
}
129132

130-
self.initialized_logits.push(self.llama_batch.n_tokens - 1);
131-
132133
Ok(())
133134
}
134135

0 commit comments

Comments
 (0)