download: do not exit() on error (#23008)

This commit is contained in:
Xuan-Son Nguyen
2026-05-13 15:14:58 +02:00
committed by GitHub
parent 5d44db6008
commit e75cd5efb5
+2 -4
View File
@@ -357,8 +357,7 @@ static handle_model_result common_params_handle_model(struct common_params_model
auto download_result = common_download_model(model, opts, true); auto download_result = common_download_model(model, opts, true);
if (download_result.model_path.empty()) { if (download_result.model_path.empty()) {
LOG_ERR("error: failed to download model from Hugging Face\n"); throw std::runtime_error("failed to download model from Hugging Face");
exit(1);
} }
model.name = model.hf_repo; model.name = model.hf_repo;
@@ -380,8 +379,7 @@ static handle_model_result common_params_handle_model(struct common_params_model
opts.offline = offline; opts.offline = offline;
auto download_result = common_download_model(model, opts); auto download_result = common_download_model(model, opts);
if (download_result.model_path.empty()) { if (download_result.model_path.empty()) {
LOG_ERR("error: failed to download model from %s\n", model.url.c_str()); throw std::runtime_error("failed to download model from " + model.url);
exit(1);
} }
} }