From: Yuri Khrustalev Date: Sat, 14 Sep 2024 09:54:37 +0000 (-0400) Subject: ggml : ggml_type_name return "NONE" for invalid values (llama/9458) X-Git-Tag: upstream/0.0.1642~370 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=971dd50812340c4203f2a90c02f2e941c4a6a33c;p=pkg%2Fggml%2Fsources%2Fggml ggml : ggml_type_name return "NONE" for invalid values (llama/9458) When running on Windows, the quantization utility attempts to print the types that are not set which leads to a crash. --- diff --git a/src/ggml.c b/src/ggml.c index 510f08fd..bafa560d 100644 --- a/src/ggml.c +++ b/src/ggml.c @@ -3384,7 +3384,7 @@ double ggml_type_sizef(enum ggml_type type) { } GGML_CALL const char * ggml_type_name(enum ggml_type type) { - return type_traits[type].type_name; + return type < GGML_TYPE_COUNT ? type_traits[type].type_name : "NONE"; } GGML_CALL bool ggml_is_quantized(enum ggml_type type) {