Skip to content

Commit

Permalink
ggml : ggml_type_name return "NONE" for invalid values (ggerganov#9458)
Browse files Browse the repository at this point in the history
When running on Windows, the quantization utility attempts to print the types that are not set which leads to a crash.
  • Loading branch information
ykhrustalev authored Sep 14, 2024
1 parent dcdcee3 commit 822b632
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ggml/src/ggml.c
Original file line number Diff line number Diff line change
Expand Up @@ -3399,7 +3399,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) {
Expand Down

0 comments on commit 822b632

Please sign in to comment.