server : check draft context creation error (#24922)
This commit is contained in:
@@ -89,7 +89,9 @@ struct server_batch {
|
|||||||
}
|
}
|
||||||
|
|
||||||
~server_batch() {
|
~server_batch() {
|
||||||
llama_batch_free(batch);
|
if (batch.token != nullptr) {
|
||||||
|
llama_batch_free(batch);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void init(int32_t n_tokens_alloc) {
|
void init(int32_t n_tokens_alloc) {
|
||||||
@@ -1215,6 +1217,10 @@ private:
|
|||||||
cparams.ctx_other = ctx_tgt;
|
cparams.ctx_other = ctx_tgt;
|
||||||
|
|
||||||
ctx_dft.reset(llama_init_from_model(model_dft.get(), cparams));
|
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_tgt = ctx_tgt;
|
||||||
params_base.speculative.draft.ctx_dft = ctx_dft.get();
|
params_base.speculative.draft.ctx_dft = ctx_dft.get();
|
||||||
|
|||||||
Reference in New Issue
Block a user