Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions tools/server/server-context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ struct server_slot {
prompt.tokens.insert(spec_draft);
}

void release() {
void release(bool clear_prompt = false) {
if (is_processing()) {
GGML_ASSERT(task);

Expand All @@ -453,7 +453,7 @@ struct server_slot {
state = SLOT_STATE_IDLE;

// do not keep context of the child slots - the parent's context is enough
if (task->is_child()) {
if (clear_prompt || task->is_child()) {
prompt_clear(false);
}
Comment on lines +456 to 458

Expand Down Expand Up @@ -2274,10 +2274,10 @@ struct server_context_impl {
} break;
case SERVER_TASK_TYPE_CANCEL:
{
// release slot linked with the task id
// release slot linked with the task id; cancelled requests should drop the slot state
for (auto & slot : slots) {
if (slot.task && slot.task->id == task.id_target) {
slot.release();
slot.release(true);
break;
}
}
Expand Down