Skip to content

Commit

Permalink
gguf : print error for GGUFv1 files (ggerganov#3908)
Browse files Browse the repository at this point in the history
  • Loading branch information
ggerganov authored and olexiyb committed Nov 23, 2023
1 parent 95cc520 commit 521f6ab
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ggml.c
Original file line number Diff line number Diff line change
Expand Up @@ -18884,6 +18884,13 @@ struct gguf_context * gguf_init_from_file(const char * fname, struct gguf_init_p
ok = ok && gguf_fread_el(file, &ctx->header.n_tensors, sizeof(ctx->header.n_tensors), &offset);
ok = ok && gguf_fread_el(file, &ctx->header.n_kv, sizeof(ctx->header.n_kv), &offset);

if (ctx->header.version == 1) {
fprintf(stderr, "%s: GGUFv1 is no longer supported. please use a more up-to-date version\n", __func__);
fclose(file);
gguf_free(ctx);
return NULL;
}

if (!ok) {
fprintf(stderr, "%s: failed to read header\n", __func__);
fclose(file);
Expand Down

0 comments on commit 521f6ab

Please sign in to comment.