@@ -208,7 +208,7 @@ void common_ngram_map_begin(
208208 count_keys, count_keys_del, count_values_del, count_map_entries_upd);
209209 }
210210
211- map.idx_last_check = (map. size_last_begin > 0 ) ? map. size_last_begin - 1 : 0 ;
211+ map.idx_last_check = size_begin ;
212212 map.size_last_begin = size_begin;
213213}
214214
@@ -231,7 +231,7 @@ void common_ngram_map_draft(common_ngram_map & map,
231231 GGML_ABORT (" %s: cur_len exceeds UINT32_MAX: %zu" , __func__, cur_len);
232232 }
233233
234- if (map.idx_last_check > cur_len) {
234+ if (map.idx_last_check > cur_len) {
235235 // Should not happen because of common_ngram_map_begin().
236236 GGML_ABORT (" %s: map.idx_last_check > cur_len: %zu > %zu" , __func__, map.idx_last_check , cur_len);
237237 }
@@ -386,7 +386,7 @@ void common_ngram_map_draft(common_ngram_map & map,
386386 LOG_DBG (" %s: key_idx = %zu, key_offset = %zu, key_num = %d, draft.size = %zu\n " , __func__,
387387 curr_key.key_idx , key_offset, curr_key.key_num , draft.size ());
388388
389- map.last_draft_created = false ;
389+ map.last_draft_created = true ;
390390 map.last_draft_key_idx = key_offset;
391391 map.last_draft_value_idx = 0 ; // value 0 is used for simple mode
392392 return ;
@@ -524,7 +524,7 @@ void common_ngram_map_accept(common_ngram_map & map, uint16_t n_accepted) {
524524 struct common_ngram_map_value & curr_value = curr_key.values [val_idx]; // value used for draft generation.
525525
526526 // update the value statistics
527- LOG_INF (" common_ngram_map_send_accepted: n_accepted = %d, prev value_num = %d\n " ,
527+ LOG_DBG (" common_ngram_map_send_accepted: n_accepted = %d, prev value_num = %d\n " ,
528528 n_accepted, curr_value.n_accepted );
529529 curr_value.n_accepted = n_accepted;
530530}
0 commit comments