server : check draft context creation error (#24922)

This commit is contained in:
kononnable 2026-06-23 16:56:50 +02:00 committed by GitHub
parent 72a9269172
commit be4a6a63eb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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();