File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 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) {
11021102 mparams.tensor_buft_overrides = params.tensor_buft_overrides .data ();
11031103 }
11041104
1105+ mparams.progress_callback = params.load_progress_callback ;
1106+ mparams.progress_callback_user_data = params.load_progress_callback_user_data ;
1107+
11051108 return mparams;
11061109}
11071110
Original file line number Diff line number Diff line change @@ -428,6 +428,11 @@ struct common_params {
428428
429429 // common params
430430 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 ;
431436};
432437
433438// call once at the start of a program if it uses libcommon
You can’t perform that action at this time.
0 commit comments