better alloc error

This commit is contained in:
Concedo 2023-06-23 22:51:51 +08:00
parent ece453ed09
commit 490cf395f8
4 changed files with 4 additions and 4 deletions

View file

@ -422,7 +422,7 @@ bool gpt2_eval(
buf = realloc(buf, buf_size);
if (buf == nullptr)
{
fprintf(stderr, "%s: failed to allocate %zu bytes\n", __func__, buf_size);
fprintf(stderr, "%s: failed to allocate %zu bytes. Try reducing batch size.\n", __func__, buf_size);
return false;
}
}

View file

@ -417,7 +417,7 @@ bool gptj_eval(
buf = realloc(buf, buf_size);
if (buf == nullptr)
{
fprintf(stderr, "%s: failed to allocate %zu bytes\n", __func__, buf_size);
fprintf(stderr, "%s: failed to allocate %zu bytes. Try reducing batch size.\n", __func__, buf_size);
return false;
}
}

View file

@ -350,7 +350,7 @@ bool mpt_eval(const mpt_model & model, const int n_threads, const int n_past,
buf_size = buf_size_new;
buf = realloc(buf, buf_size);
if (buf == nullptr) {
fprintf(stderr, "%s: failed to allocate %zu bytes\n", __func__, buf_size);
fprintf(stderr, "%s: failed to allocate %zu bytes. Try reducing batch size.\n", __func__, buf_size);
return false;
}
}

View file

@ -435,7 +435,7 @@ bool gpt_neox_eval(
buf = realloc(buf, buf_size);
if (buf == nullptr)
{
fprintf(stderr, "%s: failed to allocate %zu bytes\n", __func__, buf_size);
fprintf(stderr, "%s: failed to allocate %zu bytes. Try reducing batch size.\n", __func__, buf_size);
return false;
}
}