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,12 +336,16 @@ 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;
if (wtype != GGML_TYPE_COUNT && ggml_is_quantized(wtype)) {
have_quantized_weight = true;
} else {
for (const auto& [type, _] : wtype_stat) { for (const auto& [type, _] : wtype_stat) {
if (ggml_is_quantized(type)) { if (ggml_is_quantized(type)) {
have_quantized_weight = true; have_quantized_weight = true;
break; break;
} }
} }
}
if (have_quantized_weight) { if (have_quantized_weight) {
apply_lora_immediately = false; apply_lora_immediately = false;
} else { } else {