refactor format
This commit is contained in:
parent
a90b398b2f
commit
eb42fb79da
1 changed files with 10 additions and 13 deletions
|
@ -912,22 +912,19 @@ struct server_context {
|
||||||
|
|
||||||
// get prompt
|
// get prompt
|
||||||
if (!task.infill) {
|
if (!task.infill) {
|
||||||
{
|
const auto & prompt = data.find("prompt");
|
||||||
const auto & prompt = data.find("prompt");
|
if (prompt == data.end()) {
|
||||||
if (prompt == data.end()) {
|
send_error(task, "Either \"prompt\" or \"messages\" must be provided", ERROR_TYPE_INVALID_REQUEST);
|
||||||
send_error(task, "Either \"prompt\" or \"messages\" must be provided", ERROR_TYPE_INVALID_REQUEST);
|
return false;
|
||||||
return false;
|
} else {
|
||||||
} else {
|
slot.prompt = *prompt;
|
||||||
slot.prompt = *prompt;
|
}
|
||||||
}
|
if (slot.prompt.is_array() && slot.prompt.size() == 0) {
|
||||||
if (slot.prompt.is_array() && slot.prompt.size() == 0) {
|
send_error(task, "\"prompt\" cannot be an empty array", ERROR_TYPE_INVALID_REQUEST);
|
||||||
send_error(task, "\"prompt\" cannot be an empty array", ERROR_TYPE_INVALID_REQUEST);
|
return false;
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// penalize user-provided tokens
|
// penalize user-provided tokens
|
||||||
{
|
{
|
||||||
slot.sparams.penalty_prompt_tokens.clear();
|
slot.sparams.penalty_prompt_tokens.clear();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue