Просмотр исходного кода

perplexity : fix kv cache handling for hellaswag (#4981)

ggml-ci
Georgi Gerganov 2 лет назад
Родитель
Сommit
959ef0c0df
1 измененных файлов с 1 добавлено и 0 удалено
  1. 1 0
      examples/perplexity/perplexity.cpp

+ 1 - 0
examples/perplexity/perplexity.cpp

@@ -428,6 +428,7 @@ static std::vector<float> hellaswag_evaluate_tokens(
     for (size_t i_chunk = 0; i_chunk < n_chunk; ++i_chunk) {
         size_t n_tokens = tokens.size() - i_chunk * n_batch;
         n_tokens = std::min(n_tokens, size_t(n_batch));
+        llama_kv_cache_seq_rm(ctx, 0, n_past, -1);
         if (llama_decode(ctx, llama_batch_get_one(tokens.data() + i_chunk * n_batch, n_tokens, n_past, 0))) {
             fprintf(stderr, "%s : failed to eval\n", __func__);
             return {};