Skip to content

Commit

Permalink
imatrix : fix segfault when using a single chunk per batch
Browse files Browse the repository at this point in the history
  • Loading branch information
compilade committed Aug 20, 2024
1 parent bce5464 commit 347247a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/imatrix/imatrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ static bool compute_imatrix(llama_context * ctx, const gpt_params & params, cons
if (params.compute_ppl) {
const int first = n_ctx/2;
for (int seq = 0; seq < n_seq_batch; seq++) {
const float * all_logits = num_batches > 1 ? logits.data() : llama_get_logits_ith(ctx, seq*n_ctx + first);
const float * all_logits = num_batches > 1 ? logits.data() : llama_get_logits_ith(ctx, seq*n_ctx);

llama_token * tokens_data = tokens.data() + start + seq*n_ctx + first;

Expand Down

0 comments on commit 347247a

Please sign in to comment.