Skip to content

Commit 3106005

Browse files
fixup! lookup: evaluation tools, use corpus/previous gens
1 parent e2f6704 commit 3106005

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

common/ngram-cache.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ void llama_ngram_cache_update(llama_ngram_cache & ngram_cache, int ngram_min, in
88
const int64_t t_start_ms = ggml_time_ms();
99
const int64_t inp_size = inp.size();
1010

11-
const int64_t n_todo = inp_size * (ngram_max - ngram_min + 1);
12-
int64_t n_done = 0;
11+
const long n_todo = inp_size * (ngram_max - ngram_min + 1);
12+
long n_done = 0;
1313

1414
for (int64_t ngram_size = ngram_min; ngram_size <= ngram_max; ++ngram_size) {
1515
const int64_t i_start = std::max(inp_size - nnew, ngram_size);
@@ -34,10 +34,10 @@ void llama_ngram_cache_update(llama_ngram_cache & ngram_cache, int ngram_min, in
3434
++n_done;
3535

3636
if (print_progress && n_done % 10000000 == 0) {
37-
const int64_t t_now_ms = ggml_time_ms();
38-
const int64_t eta_ms = (inp_size*(ngram_max-ngram_min+1) - n_done) * (t_now_ms - t_start_ms) / n_done;
39-
const int64_t eta_min = eta_ms / (60*1000);
40-
const int64_t eta_s = (eta_ms - 60*1000*eta_min) / 1000;
37+
const long t_now_ms = ggml_time_ms();
38+
const long eta_ms = (inp_size*(ngram_max-ngram_min+1) - n_done) * (t_now_ms - t_start_ms) / n_done;
39+
const long eta_min = eta_ms / (60*1000);
40+
const long eta_s = (eta_ms - 60*1000*eta_min) / 1000;
4141

4242
fprintf(stderr, "%s: %ld/%ld done, ETA: %02ld:%02ld\n", __func__, n_done, n_todo, eta_min, eta_s);
4343
}

0 commit comments

Comments
 (0)