We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 72a9269 commit be4a6a6Copy full SHA for be4a6a6
1 file changed
tools/server/server-context.cpp
@@ -89,7 +89,9 @@ struct server_batch {
89
}
90
91
~server_batch() {
92
- llama_batch_free(batch);
+ if (batch.token != nullptr) {
93
+ llama_batch_free(batch);
94
+ }
95
96
97
void init(int32_t n_tokens_alloc) {
@@ -1215,6 +1217,10 @@ struct server_context_impl {
1215
1217
cparams.ctx_other = ctx_tgt;
1216
1218
1219
ctx_dft.reset(llama_init_from_model(model_dft.get(), cparams));
1220
+ if (ctx_dft == nullptr) {
1221
+ SRV_ERR("%s", "failed to create draft context\n");
1222
+ return false;
1223
1224
1225
params_base.speculative.draft.ctx_tgt = ctx_tgt;
1226
params_base.speculative.draft.ctx_dft = ctx_dft.get();
0 commit comments