mirror of
https://github.com/ggerganov/llama.cpp.git
synced 2024-12-25 02:44:36 +00:00
ggml : add friendlier error message to fopen errors (#8575)
* Add additional error information when model files fail to load. * Adding additional error information to most instances of fopen.
This commit is contained in:
parent
f299aa98ec
commit
b57eb9ca4f
@ -19019,7 +19019,7 @@ void ggml_graph_export(const struct ggml_cgraph * cgraph, const char * fname) {
|
|||||||
FILE * fout = ggml_fopen(fname, "wb");
|
FILE * fout = ggml_fopen(fname, "wb");
|
||||||
|
|
||||||
if (!fout) {
|
if (!fout) {
|
||||||
fprintf(stderr, "%s: failed to open %s\n", __func__, fname);
|
fprintf(stderr, "%s: failed to open %s: %s\n", __func__, fname, strerror(errno));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -19156,7 +19156,7 @@ struct ggml_cgraph * ggml_graph_import(const char * fname, struct ggml_context *
|
|||||||
{
|
{
|
||||||
FILE * fin = ggml_fopen(fname, "rb");
|
FILE * fin = ggml_fopen(fname, "rb");
|
||||||
if (!fin) {
|
if (!fin) {
|
||||||
fprintf(stderr, "%s: failed to open %s\n", __func__, fname);
|
fprintf(stderr, "%s: failed to open %s: %s\n", __func__, fname, strerror(errno));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -20830,6 +20830,7 @@ struct gguf_context * gguf_init_empty(void) {
|
|||||||
struct gguf_context * gguf_init_from_file(const char * fname, struct gguf_init_params params) {
|
struct gguf_context * gguf_init_from_file(const char * fname, struct gguf_init_params params) {
|
||||||
FILE * file = ggml_fopen(fname, "rb");
|
FILE * file = ggml_fopen(fname, "rb");
|
||||||
if (!file) {
|
if (!file) {
|
||||||
|
fprintf(stderr, "%s: failed to open '%s': '%s'\n", __func__, fname, strerror(errno));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user