mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2026-07-10 01:18:32 +00:00
server : check draft context creation error (#24922)
This commit is contained in:
parent
72a9269172
commit
be4a6a63eb
1 changed files with 7 additions and 1 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue