server : fix switch fallthrough

This commit is contained in:
Georgi Gerganov 2023-10-22 16:55:05 +03:00
parent 715f384a6b
commit 197a0a9e23
No known key found for this signature in database
GPG key ID: 449E073F9DC10735

View file

@ -1358,14 +1358,16 @@ struct llama_server_context
{ {
case COMPLETION_TASK: { case COMPLETION_TASK: {
llama_client_slot* slot = get_slot(json_value(task.data, "slot_id", -1)); llama_client_slot* slot = get_slot(json_value(task.data, "slot_id", -1));
if (slot == nullptr) { if (slot == nullptr)
{
LOG_TEE("slot unavailable\n"); LOG_TEE("slot unavailable\n");
// send error result // send error result
send_error(task.id, "slot unavaliable"); send_error(task.id, "slot unavaliable");
return; return;
} }
if (task.data.contains("system_prompt")) { if (task.data.contains("system_prompt"))
{
process_system_prompt_data(task.data["system_prompt"]); process_system_prompt_data(task.data["system_prompt"]);
} }
@ -1380,7 +1382,7 @@ struct llama_server_context
send_error(task.id, "internal_error"); send_error(task.id, "internal_error");
break; break;
} }
} } break;
case CANCEL_TASK: { // release slot linked with the task id case CANCEL_TASK: { // release slot linked with the task id
for (auto & slot : slots) { for (auto & slot : slots) {
if (slot.task_id == task.target_id) { if (slot.task_id == task.target_id) {
@ -1388,11 +1390,7 @@ struct llama_server_context
break; break;
} }
} }
} } break;
break;
default:
break;
} }
} }
} }