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
+4
+4
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 {