mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-09-11 04:14:52 +00:00
Fix batch_pos
Signed-off-by: Adrien Gallouët <angt@huggingface.co>
This commit is contained in:
parent
e88a527fcf
commit
f38c34aeb7
@ -226,7 +226,7 @@ impl Llamacpp {
|
||||
pos: bindings::llama_pos,
|
||||
seq_id: bindings::llama_seq_id,
|
||||
logits: bool,
|
||||
) {
|
||||
) -> usize {
|
||||
let n = self.batch.n_tokens as usize;
|
||||
unsafe {
|
||||
*self.batch.token.add(n) = token;
|
||||
@ -236,6 +236,7 @@ impl Llamacpp {
|
||||
*self.batch.logits.add(n) = logits as i8;
|
||||
}
|
||||
self.batch.n_tokens += 1;
|
||||
n
|
||||
}
|
||||
|
||||
// useless ?
|
||||
@ -578,8 +579,7 @@ impl LlamacppBackend {
|
||||
|
||||
for seq in seqs.iter_mut() {
|
||||
if seq.running {
|
||||
llamacpp.batch_push(seq.token, seq.pos, seq.id as _, true);
|
||||
seq.batch_pos = 0;
|
||||
seq.batch_pos = llamacpp.batch_push(seq.token, seq.pos, seq.id as _, true);
|
||||
seq.pos += 1;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user