Skip to content

Commit 8ed2a8e

Browse files
committed
move final progress_callback call to load_all_data
1 parent ecb23d4 commit 8ed2a8e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

llama.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2435,6 +2435,10 @@ struct llama_model_loader {
24352435
mapping->unmap(0, mmap_first);
24362436
mapping->unmap(mmap_last, mapping->size - mmap_last);
24372437
}
2438+
2439+
if (progress_callback) {
2440+
progress_callback(1.0f, progress_callback_user_data);
2441+
}
24382442
}
24392443
};
24402444

@@ -3691,10 +3695,6 @@ static void llm_load_tensors(
36913695

36923696
ml.load_all_data(ctx, progress_callback, progress_callback_user_data, buf_mmap, use_mlock ? &model.mlock_mmap : NULL);
36933697

3694-
if (progress_callback) {
3695-
progress_callback(1.0f, progress_callback_user_data);
3696-
}
3697-
36983698
model.mapping = std::move(ml.mapping);
36993699

37003700
// loading time will be recalculate after the first eval, so

0 commit comments

Comments
 (0)