Skip to content

Commit

Permalink
server : fix free of spec context and batch (ggerganov#10651)
Browse files Browse the repository at this point in the history
ggml-ci
  • Loading branch information
ggerganov authored Dec 7, 2024
1 parent 3df784b commit c2a16c0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions common/speculative.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ struct common_speculative * common_speculative_init(
}

void common_speculative_free(struct common_speculative * spec) {
if (spec == nullptr) {
return;
}

common_sampler_free(spec->smpl);

llama_batch_free(spec->batch);
Expand Down
2 changes: 1 addition & 1 deletion examples/server/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ struct server_slot {
int id;
int id_task = -1;

llama_batch batch_spec;
llama_batch batch_spec = {};

llama_context * ctx_dft = nullptr;

Expand Down

0 comments on commit c2a16c0

Please sign in to comment.