Skip to content

Commit

Permalink
Fix after merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Kawrakow committed Aug 12, 2024
1 parent 3188517 commit 5f9350e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ggml/src/ggml.c
Original file line number Diff line number Diff line change
Expand Up @@ -21549,7 +21549,12 @@ struct gguf_context * gguf_init_from_file(const char * fname, struct gguf_init_p
ctx->infos[i].ne[3],
};

struct ggml_tensor * cur = ggml_new_tensor(ctx_data, ctx->infos[i].type, ctx->infos[i].n_dims, ne);
int n_dims = ctx->infos[i].n_dims;
if (n_dims == 0 || n_dims > 4) {
n_dims = 4;
for (; n_dims > 1; --n_dims) if (ne[n_dims-1] > 1) break;
}
struct ggml_tensor * cur = ggml_new_tensor(ctx_data, ctx->infos[i].type, n_dims, ne);

ok = ok && cur != NULL;

Expand Down

0 comments on commit 5f9350e

Please sign in to comment.