]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
server : properly handle null llama_context (#25868)
authorfairydreaming <redacted>
Tue, 21 Jul 2026 15:47:17 +0000 (17:47 +0200)
committerGitHub <redacted>
Tue, 21 Jul 2026 15:47:17 +0000 (17:47 +0200)
Co-authored-by: Stanisław Szymczyk <redacted>
tools/server/server-context.cpp

index 715477e2e08d86f1ed6b6dcb47583d9f73a99815..744593c760a3d22bf289787ca47b4e8a2d595f08 100644 (file)
@@ -1152,6 +1152,11 @@ private:
             return false;
         }
 
+        if (ctx_tgt == nullptr) {
+            SRV_ERR("failed to create_context with model '%s'\n", params_base.model.path.c_str());
+            return false;
+        }
+
         vocab = llama_model_get_vocab(model_tgt);
 
         n_ctx = llama_n_ctx(ctx_tgt);