server: health:
* include_slots only if slots_endpoint * fix compile warning task.target_id not initialized.
This commit is contained in:
parent
87ceb1a42b
commit
d73456ac59
2 changed files with 4 additions and 2 deletions
|
@ -140,7 +140,7 @@ node index.js
|
||||||
- 200 -> `{"status": "no slot available", "slots_idle": 0, "slots_processing": 32}` if no slot are currently available.
|
- 200 -> `{"status": "no slot available", "slots_idle": 0, "slots_processing": 32}` if no slot are currently available.
|
||||||
- 503 -> `{"status": "no slot available", "slots_idle": 0, "slots_processing": 32}` if the query parameter `fail_on_no_slot` is provided and no slot are currently available.
|
- 503 -> `{"status": "no slot available", "slots_idle": 0, "slots_processing": 32}` if the query parameter `fail_on_no_slot` is provided and no slot are currently available.
|
||||||
|
|
||||||
If the query parameter `include_slots` is passed, `slots` field will contain internal slots data.
|
If the query parameter `include_slots` is passed, `slots` field will contain internal slots data except if `--slots-endpoint-disable` is set.
|
||||||
|
|
||||||
- **POST** `/completion`: Given a `prompt`, it returns the predicted completion.
|
- **POST** `/completion`: Given a `prompt`, it returns the predicted completion.
|
||||||
|
|
||||||
|
|
|
@ -2601,6 +2601,7 @@ int main(int argc, char **argv)
|
||||||
task_server task;
|
task_server task;
|
||||||
task.id = llama.queue_tasks.get_new_id();
|
task.id = llama.queue_tasks.get_new_id();
|
||||||
task.type = TASK_TYPE_SLOTS_DATA;
|
task.type = TASK_TYPE_SLOTS_DATA;
|
||||||
|
task.target_id = -1;
|
||||||
|
|
||||||
llama.queue_results.add_waiting_task_id(task.id);
|
llama.queue_results.add_waiting_task_id(task.id);
|
||||||
llama.queue_tasks.post(task);
|
llama.queue_tasks.post(task);
|
||||||
|
@ -2617,7 +2618,7 @@ int main(int argc, char **argv)
|
||||||
{"slots_idle", n_idle_slots},
|
{"slots_idle", n_idle_slots},
|
||||||
{"slots_processing", n_processing_slots}};
|
{"slots_processing", n_processing_slots}};
|
||||||
res.status = 200; // HTTP OK
|
res.status = 200; // HTTP OK
|
||||||
if (req.has_param("include_slots")) {
|
if (sparams.slots_endpoint && req.has_param("include_slots")) {
|
||||||
health["slots"] = result.result_json["slots"];
|
health["slots"] = result.result_json["slots"];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2647,6 +2648,7 @@ int main(int argc, char **argv)
|
||||||
task_server task;
|
task_server task;
|
||||||
task.id = llama.queue_tasks.get_new_id();
|
task.id = llama.queue_tasks.get_new_id();
|
||||||
task.type = TASK_TYPE_SLOTS_DATA;
|
task.type = TASK_TYPE_SLOTS_DATA;
|
||||||
|
task.target_id = -1;
|
||||||
|
|
||||||
llama.queue_results.add_waiting_task_id(task.id);
|
llama.queue_results.add_waiting_task_id(task.id);
|
||||||
llama.queue_tasks.post(task);
|
llama.queue_tasks.post(task);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue