Prevent crash on quantization executable

When running on Windows, the quantization utility attempts to print the types that are not set which leads to a crash.
This commit is contained in:
Yuri Khrustalev 2024-09-12 22:46:34 -04:00 committed by GitHub
parent bd35cb0ae3
commit b3b84732f9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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) {