LLM inference in C/C++
C++ ggml
server : check draft context creation error (#24922)
kononnablebe4a6a63eb2b
diff --git a/tools/server/server-context.cpp b/tools/server/server-context.cppindex ca91449d26..39b7eb218e 100644--- a/tools/server/server-context.cpp+++ b/tools/server/server-context.cpp@@ -89,7 +89,9 @@ struct server_batch {}~server_batch() {- llama_batch_free(batch);+ if (batch.token != nullptr) {+ llama_batch_free(batch);+ }}void init(int32_t n_tokens_alloc) {@@ -1215,6 +1217,10 @@ private:cparams.ctx_other = ctx_tgt;ctx_dft.reset(llama_init_from_model(model_dft.get(), cparams));+ if (ctx_dft == nullptr) {+ SRV_ERR("%s", "failed to create draft context\n");+ return false;+ }params_base.speculative.draft.ctx_tgt = ctx_tgt;params_base.speculative.draft.ctx_dft = ctx_dft.get();