Skip to content

Commit 37964f4

Browse files
authored
mtmd : fix padding of n_tokens (ggml-org#19930)
1 parent 01cd448 commit 37964f4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tools/mtmd/mtmd-helper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ int32_t mtmd_helper_decode_image_chunk(
248248

249249
int32_t n_tokens = mtmd_input_chunk_get_n_tokens(chunk);
250250
int32_t i_batch = 0;
251-
int32_t n_img_batches = GGML_PAD(n_tokens, n_batch) / n_batch;
251+
int32_t n_img_batches = (n_tokens + n_batch - 1) / n_batch;
252252
decode_embd_batch batch_embd(encoded_embd, n_tokens, n_pos_per_embd, n_mmproj_embd);
253253

254254
if (mtmd_decode_use_mrope(ctx)) {

0 commit comments

Comments
 (0)