]> git.djapps.eu Git - pkg/ggml/sources/ggml/commitdiff
gguf : handle null name during init (llama/8587)
authorGeorgi Gerganov <redacted>
Sat, 20 Jul 2024 14:15:42 +0000 (17:15 +0300)
committerGeorgi Gerganov <redacted>
Sat, 27 Jul 2024 15:26:12 +0000 (18:26 +0300)
src/ggml.c

index e89efb32f3d674e3760a94af2bf87d0cc3a5cb65..aeb6c0099ee0702f0ee393f8cbb9e1f2e68d449d 100644 (file)
@@ -21014,7 +21014,7 @@ struct gguf_context * gguf_init_from_file(const char * fname, struct gguf_init_p
             gguf_tensor_info_sanitize(info);
 
             // make sure there is no duplicated tensor names
-            for (uint64_t j = 0; j < i; ++j) {
+            for (uint64_t j = 0; j < i && ok; ++j) {
                 if (strcmp(info->name.data, ctx->infos[j].name.data) == 0) {
                     fprintf(stderr, "%s: duplicated tensor name %s\n", __func__, info->name.data);
                     ok = false;