gguf : handle null name during init

This commit is contained in:
Georgi Gerganov 2024-07-19 13:45:00 +03:00
parent f299aa98ec
commit 38061254b9
No known key found for this signature in database
GPG key ID: BF970631944C16B7
2 changed files with 6 additions and 1 deletions

View file

@ -92,6 +92,11 @@ static bool gguf_ex_read_0(const std::string & fname) {
struct gguf_context * ctx = gguf_init_from_file(fname.c_str(), params);
if (!ctx) {
fprintf(stderr, "%s: failed to load '%s'\n", __func__, fname.c_str());
return false;
}
printf("%s: version: %d\n", __func__, gguf_get_version(ctx));
printf("%s: alignment: %zu\n", __func__, gguf_get_alignment(ctx));
printf("%s: data offset: %zu\n", __func__, gguf_get_data_offset(ctx));