From 03efb92fdedf3bf604aed0c78d3fbf8e5368c020 Mon Sep 17 00:00:00 2001 From: ochafik Date: Fri, 4 Oct 2024 13:22:57 +0100 Subject: [PATCH] `server`: support cancellation of prompt processing --- examples/server/server.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/examples/server/server.cpp b/examples/server/server.cpp index 8f8a91ad5..c4dde5347 100644 --- a/examples/server/server.cpp +++ b/examples/server/server.cpp @@ -1877,6 +1877,13 @@ struct server_context { system_prompt_update(); } + for (auto & slot : slots) { + if (slot.is_processing() && slot.is_alive && !slot.is_alive()) { + SLT_WRN(slot, "%s", "slot connection died\n"); + slot.release(); + } + } + // check if all slots are idle { bool all_idle = true;