diff --git a/examples/server/server.cpp b/examples/server/server.cpp index ceaeb1f76..7e0d068f8 100644 --- a/examples/server/server.cpp +++ b/examples/server/server.cpp @@ -671,6 +671,13 @@ struct server_context { model = nullptr; } + // Clear any sampling context + for (server_slot & slot : slots) { + if (slot.ctx_sampling != nullptr) { + llama_sampling_free(slot.ctx_sampling); + } + } + llama_batch_free(batch); }