filter empty stopping strings
This commit is contained in:
parent
276fa99873
commit
43d295fddc
1 changed files with 5 additions and 3 deletions
|
@ -608,10 +608,12 @@ bool parse_options_completion(json body, llama_server_context& llama, Response &
|
||||||
res.status = 400;
|
res.status = 400;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!body["stop"].is_null()) {
|
|
||||||
llama.params.antiprompt = body["stop"].get<std::vector<std::string>>();
|
|
||||||
} else {
|
|
||||||
llama.params.antiprompt.clear();
|
llama.params.antiprompt.clear();
|
||||||
|
if (!body["stop"].is_null()) {
|
||||||
|
const auto stop = body["stop"].get<std::vector<std::string>>();
|
||||||
|
std::copy_if(stop.begin(), stop.end(),
|
||||||
|
std::back_inserter(llama.params.antiprompt),
|
||||||
|
[](const std::string &str) { return !str.empty(); });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (llama.verbose) {
|
if (llama.verbose) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue