]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
Better error when using both LoRA + GPU layers (#1861)
authorJohannes Gäßler <redacted>
Thu, 15 Jun 2023 17:06:46 +0000 (19:06 +0200)
committerGitHub <redacted>
Thu, 15 Jun 2023 17:06:46 +0000 (19:06 +0200)
examples/common.cpp

index dc69e537344dae4411ed87e544b6870194bdb1ad..b47f06273a4b6a743637f329b108c11960baccec 100644 (file)
@@ -412,6 +412,14 @@ bool gpt_params_parse(int argc, char ** argv, gpt_params & params) {
         gpt_print_usage(argc, argv, default_params);
         exit(1);
     }
+
+#ifdef GGML_USE_CUBLAS
+    if (!params.lora_adapter.empty() && params.n_gpu_layers > 0) {
+        fprintf(stderr, "%s: error: the simultaneous use of LoRAs and GPU acceleration is not supported", __func__);
+        exit(1);
+    }
+#endif // GGML_USE_CUBLAS
+
     if (escape_prompt) {
         process_escapes(params.prompt);
     }