Skip to content

Commit 9f4458d

Browse files
committed
Fix logits sorted flag.
1 parent 86646c4 commit 9f4458d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

llama.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2655,7 +2655,7 @@ void llama_sample_frequency_and_presence_penalties(struct llama_context * ctx, l
26552655
// Internal helper function for sequence matching.
26562656
static size_t llama_seqrep_find_match(const llama_token * last_tokens_p, const size_t last_tokens_size, int offset, const size_t min_length, int tolerance) {
26572657

2658-
if (min_length < 2 || last_tokens_size < min_length || (size_t)offset < min_length - 1) {
2658+
if (min_length < 2 || last_tokens_size <= min_length || size_t(offset) < min_length - 1) {
26592659
return 0;
26602660
}
26612661

@@ -2760,6 +2760,8 @@ void llama_sample_seqrep_penalty(struct llama_context * ctx, llama_token_data_ar
27602760
* (ends_on_word || pt_starts_word ? 1.0f : mid_word_scale);
27612761
}
27622762

2763+
candidates->sorted = false;
2764+
27632765
if (ctx) {
27642766
ctx->t_sample_us += ggml_time_us() - t_start_sample_us;
27652767
}

0 commit comments

Comments
 (0)