Skip to content

Commit 822b632

Browse files
authored
ggml : ggml_type_name return "NONE" for invalid values (ggml-org#9458)
When running on Windows, the quantization utility attempts to print the types that are not set which leads to a crash.
1 parent dcdcee3 commit 822b632

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ggml/src/ggml.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3399,7 +3399,7 @@ double ggml_type_sizef(enum ggml_type type) {
33993399
}
34003400

34013401
GGML_CALL const char * ggml_type_name(enum ggml_type type) {
3402-
return type_traits[type].type_name;
3402+
return type < GGML_TYPE_COUNT ? type_traits[type].type_name : "NONE";
34033403
}
34043404

34053405
GGML_CALL bool ggml_is_quantized(enum ggml_type type) {

0 commit comments

Comments
 (0)