File tree 2 files changed +8
-0
lines changed 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -1102,6 +1102,9 @@ struct llama_model_params common_model_params_to_llama(common_params & params) {
1102
1102
mparams.tensor_buft_overrides = params.tensor_buft_overrides .data ();
1103
1103
}
1104
1104
1105
+ mparams.progress_callback = params.load_progress_callback ;
1106
+ mparams.progress_callback_user_data = params.load_progress_callback_user_data ;
1107
+
1105
1108
return mparams;
1106
1109
}
1107
1110
Original file line number Diff line number Diff line change @@ -428,6 +428,11 @@ struct common_params {
428
428
429
429
// common params
430
430
std::string out_file; // output filename for all example programs
431
+ // optional callback for model loading progress and cancellation:
432
+ // called with a progress value between 0.0 and 1.0.
433
+ // return false from callback to abort model loading or true to continue
434
+ llama_progress_callback load_progress_callback = NULL ;
435
+ void * load_progress_callback_user_data = NULL ;
431
436
};
432
437
433
438
// call once at the start of a program if it uses libcommon
You can’t perform that action at this time.
0 commit comments