diff options
author | Georgi Gerganov <ggerganov@gmail.com> | 2023-11-02 16:22:30 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-02 16:22:30 +0200 |
commit | 4ff1046d75e64f0e556d8dcd930ea25c23eb8b18 (patch) | |
tree | 9f521ac36f6618711fb181fd1911bf5116f9e1cd | |
parent | 21958bb393a654591ed26f339791b752d58f5c8b (diff) |
gguf : print error for GGUFv1 files (#3908)
-rw-r--r-- | ggml.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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); |