@@ -13044,7 +13044,7 @@ void llama_sample_min_p(struct llama_context * ctx, llama_token_data_array * can
13044
13044
}
13045
13045
}
13046
13046
13047
- void llama_sample_dry(struct llama_context * ctx, llama_token_data_array * candidates, const llama_token * last_tokens, int last_token_size , float dry_base, float dry_multiplier, int dry_allowed_length, const llama_token * seq_breakers, int seq_breakers_size) {
13047
+ void llama_sample_dry(struct llama_context * ctx, llama_token_data_array * candidates, const llama_token * last_tokens, size_t last_tokens_size , float dry_base, float dry_multiplier, int dry_allowed_length, const llama_token * seq_breakers, size_t seq_breakers_size) {
13048
13048
// loop through each candidate
13049
13049
for (size_t i = 0; i < candidates->size; ++i) {
13050
13050
@@ -13056,7 +13056,7 @@ void llama_sample_dry(struct llama_context * ctx, llama_token_data_array * candi
13056
13056
int max_match_length = 0;
13057
13057
13058
13058
// loop through each previous token
13059
- for (size_t j = 0; j < last_token_size ; ++j) {
13059
+ for (size_t j = 0; j < last_tokens_size ; ++j) {
13060
13060
// if the current candidate is the same as the previous token
13061
13061
if (candidates->data[i].id == last_tokens[j]) {
13062
13062
// greedily match sequence backwards starting from the current position with the end of prev
@@ -13069,13 +13069,13 @@ void llama_sample_dry(struct llama_context * ctx, llama_token_data_array * candi
13069
13069
13070
13070
// this shouldn't happen because (j - match_length) should always be smaller than (size - match_length)
13071
13071
// but let's check here to avoid the unexpected
13072
- if(last_token_size - match_length < 0) break;
13072
+ if(last_tokens_size - match_length < 0) break;
13073
13073
13074
13074
// compare token starts at our prev index, going backwards by match length
13075
13075
auto compare_token = last_tokens[j - match_length];
13076
13076
13077
13077
// head token starts at the end of prev, going backwards by match length
13078
- auto head_token = last_tokens[last_token_size - match_length];
13078
+ auto head_token = last_tokens[last_tokens_size - match_length];
13079
13079
13080
13080
// if compare token is part of the sequence breakers, break out of the match
13081
13081
if(std::find(seq_breakers, seq_breakers + seq_breakers_size, compare_token) != seq_breakers + seq_breakers_size)
0 commit comments