]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
gguf-split: add --no-tensor-first-split (llama/7072)
authorXuan Son Nguyen <redacted>
Sat, 4 May 2024 16:56:22 +0000 (18:56 +0200)
committerGeorgi Gerganov <redacted>
Mon, 13 May 2024 08:02:26 +0000 (11:02 +0300)
ggml.c

diff --git a/ggml.c b/ggml.c
index 00f3e170a16b95d6fa603f900f9344174ffa8373..84b76fcb96966297bdbbc966516fdb6e160648ad 100644 (file)
--- a/ggml.c
+++ b/ggml.c
@@ -21210,7 +21210,7 @@ struct gguf_context * gguf_init_from_file(const char * fname, struct gguf_init_p
     }
 
     // read the tensor infos
-    {
+    if (ctx->header.n_tensors > 0) {
         ctx->infos = GGML_CALLOC(ctx->header.n_tensors, sizeof(struct gguf_tensor_info));
 
         for (uint64_t i = 0; i < ctx->header.n_tensors; ++i) {