ggerganov commited on
Commit
2f95156
·
1 Parent(s): 0083f96

gguf : handle null name during init (llama/8587)

Browse files
Files changed (1) hide show
  1. ggml/src/ggml.c +1 -1
ggml/src/ggml.c CHANGED
@@ -21014,7 +21014,7 @@ struct gguf_context * gguf_init_from_file(const char * fname, struct gguf_init_p
21014
  gguf_tensor_info_sanitize(info);
21015
 
21016
  // make sure there is no duplicated tensor names
21017
- for (uint64_t j = 0; j < i; ++j) {
21018
  if (strcmp(info->name.data, ctx->infos[j].name.data) == 0) {
21019
  fprintf(stderr, "%s: duplicated tensor name %s\n", __func__, info->name.data);
21020
  ok = false;
 
21014
  gguf_tensor_info_sanitize(info);
21015
 
21016
  // make sure there is no duplicated tensor names
21017
+ for (uint64_t j = 0; j < i && ok; ++j) {
21018
  if (strcmp(info->name.data, ctx->infos[j].name.data) == 0) {
21019
  fprintf(stderr, "%s: duplicated tensor name %s\n", __func__, info->name.data);
21020
  ok = false;