gguf : fix division by zero
This commit is contained in:
parent
312cf03328
commit
4af94d9afe
|
|
@ -615,9 +615,9 @@ struct gguf_context * gguf_init_from_file_impl(FILE * file, struct gguf_init_par
|
||||||
ok = ok && gr.read(info.t.ne[j]);
|
ok = ok && gr.read(info.t.ne[j]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// check that all ne are non-negative
|
// check that all ne are positive
|
||||||
if (info.t.ne[j] < 0) {
|
if (info.t.ne[j] <= 0) {
|
||||||
GGML_LOG_ERROR("%s: tensor '%s' dimension %" PRIu32 " has invalid number of elements: %" PRIi64 " < 0\n",
|
GGML_LOG_ERROR("%s: tensor '%s' dimension %" PRIu32 " has invalid number of elements: %" PRIi64 " <= 0\n",
|
||||||
__func__, info.t.name, j, info.t.ne[j]);
|
__func__, info.t.name, j, info.t.ne[j]);
|
||||||
ok = false;
|
ok = false;
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue