]> git.djapps.eu Git - pkg/ggml/sources/ggml/commitdiff
ggml : ggml_type_name return "NONE" for invalid values (llama/9458)
authorYuri Khrustalev <redacted>
Sat, 14 Sep 2024 09:54:37 +0000 (05:54 -0400)
committerGeorgi Gerganov <redacted>
Fri, 20 Sep 2024 19:03:57 +0000 (22:03 +0300)
When running on Windows, the quantization utility attempts to print the types that are not set which leads to a crash.

src/ggml.c

index 510f08fd0f05b83b24313a93314a2a366c093a87..bafa560d5db6f6617276b983dd39f3d30cd6e36a 100644 (file)
@@ -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) {