From 4a4718e8aba75eba48f25aa46aa370b60340408b Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Thu, 23 Mar 2023 16:18:37 -0400 Subject: [PATCH] More correct load progress --- llama.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llama.cpp b/llama.cpp index 60e4b529c..50b36493a 100644 --- a/llama.cpp +++ b/llama.cpp @@ -592,7 +592,7 @@ static bool llama_model_load( //fprintf(stderr, "%42s - [%5d, %5d], type = %6s, %6.2f MB\n", name.data(), ne[0], ne[1], ftype == 0 ? "float" : "f16", ggml_nbytes(tensor)/1024.0/1024.0); if (++n_tensors % 8 == 0) { if (progress_callback) { - double current_progress = (double(i) + (double(fin.tellg()) / double(file_size))) / double(n_parts); + double current_progress = (double(i) + (double(size_t(fin.tellg()) - file_offset) / double(file_size - file_offset))) / double(n_parts); progress_callback(current_progress, progress_callback_user_data); } fprintf(stderr, ".");