llmodel_c: improve quality of error messages (#1625)

This commit is contained in:
Jared Van Bortel
2023-11-07 11:20:14 -05:00
committed by GitHub
parent 8fabf0be4a
commit d4ce9f4a7c
11 changed files with 61 additions and 70 deletions

View File

@@ -17,11 +17,10 @@
void* load_model(const char *fname, int n_threads) {
// load the model
llmodel_error new_error{};
const char *new_error;
auto model = llmodel_model_create2(fname, "auto", &new_error);
if (model == nullptr ){
fprintf(stderr, "%s: error '%s'\n",
__func__, new_error.message);
if (model == nullptr) {
fprintf(stderr, "%s: error '%s'\n", __func__, new_error);
return nullptr;
}
if (!llmodel_loadModel(model, fname)) {