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

This commit is contained in:
Wagner Bruna 2025-11-16 03:47:36 -03:00 committed by GitHub
parent 6448430dbb
commit aa44e06890
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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