Skip to content

Commit 06a5b04

Browse files
l3utterflyngxson
andauthored
Update tools/mtmd/mtmd-helper.cpp
Co-authored-by: Xuan-Son Nguyen <[email protected]>
1 parent 23d633b commit 06a5b04

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

tools/mtmd/mtmd-helper.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -231,11 +231,12 @@ int32_t mtmd_helper_eval_chunk_single(mtmd_context * ctx,
231231
while (i < n_tokens) { // split into batches
232232
text_batch.n_tokens = 0; // clear the batch
233233
for (; i < n_tokens && text_batch.n_tokens < n_batch; i++) {
234-
text_batch.token [text_batch.n_tokens] = tokens[i];
235-
text_batch.pos [text_batch.n_tokens] = n_past++;
236-
text_batch.n_seq_id[text_batch.n_tokens] = 1;
237-
text_batch.seq_id [text_batch.n_tokens][0] = seq_id;
238-
text_batch.logits [text_batch.n_tokens] = false;
234+
int32_t j = text_batch.n_tokens;
235+
text_batch.token [j] = tokens[i];
236+
text_batch.pos [j] = n_past++;
237+
text_batch.n_seq_id[j] = 1;
238+
text_batch.seq_id [j][0] = seq_id;
239+
text_batch.logits [j] = false;
239240

240241
text_batch.n_tokens++;
241242
}

0 commit comments

Comments
 (0)