Skip to content

Commit aacf70d

Browse files
ykhrustalevggerganov
authored andcommitted
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.
1 parent 87b0f07 commit aacf70d

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
@@ -3384,7 +3384,7 @@ double ggml_type_sizef(enum ggml_type type) {
33843384
}
33853385

33863386
GGML_CALL const char * ggml_type_name(enum ggml_type type) {
3387-
return type_traits[type].type_name;
3387+
return type < GGML_TYPE_COUNT ? type_traits[type].type_name : "NONE";
33883388
}
33893389

33903390
GGML_CALL bool ggml_is_quantized(enum ggml_type type) {

0 commit comments

Comments
 (0)