revert layers if fail

This commit is contained in:
Concedo
2026-02-08 12:58:05 +08:00
parent 6bfbb5b283
commit 3d3f02ef4a
+5
View File
@@ -2582,6 +2582,11 @@ ModelLoadResult gpttype_load_model(const load_model_inputs inputs, FileFormat in
}
printf("Autofit Success: %d, Autofit Result: ",success);
print_fitted_params(model_params,llama_ctx_params);
if(!success)
{
//revert to previous
model_params.n_gpu_layers = inputs.gpulayers;
}
}
llama_model * llamamodel = llama_model_load_from_file(kcpp_data->model_filename.c_str(), model_params);