common : add callback interface for download progress (#21735)

Signed-off-by: Adrien Gallouët <angt@huggingface.co>
This commit is contained in:
Adrien Gallouët
2026-04-10 22:17:00 +02:00
committed by GitHub
parent e62fa13c24
commit 05b3caaa48
4 changed files with 126 additions and 75 deletions
+3 -1
View File
@@ -1014,7 +1014,9 @@ static cmd_params parse_cmd_params(int argc, char ** argv) {
model.hf_file = params.hf_file[i];
}
auto download_result = common_download_model(model, params.hf_token);
common_download_opts opts;
opts.bearer_token = params.hf_token;
auto download_result = common_download_model(model, opts);
if (download_result.model_path.empty()) {
fprintf(stderr, "error: failed to download model from HuggingFace\n");
exit(1);