fix: avoid crash with LoRAs and type override (#974)

This commit is contained in:
Wagner Bruna authored and GitHub committed 2025-11-16 14:47:36 +08:00
1 parent 6448430dbb
commit aa44e06890
1 file changed
+8 -4
+8 -4
View File
@@ -336,10 +336,14 @@ public:
if (sd_ctx_params->lora_apply_mode == LORA_APPLY_AUTO) { if (sd_ctx_params->lora_apply_mode == LORA_APPLY_AUTO) {
bool have_quantized_weight = false; bool have_quantized_weight = false;
for (const auto& [type, _] : wtype_stat) { if (wtype != GGML_TYPE_COUNT && ggml_is_quantized(wtype)) {
if (ggml_is_quantized(type)) { have_quantized_weight = true;
have_quantized_weight = true; } else {
break; for (const auto& [type, _] : wtype_stat) {
if (ggml_is_quantized(type)) {
have_quantized_weight = true;
break;
}
} }
} }
if (have_quantized_weight) { if (have_quantized_weight) {