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;
|
||||
return false;
|
||||
}
|
||||
llama.params.antiprompt.clear();
|
||||
if (!body["stop"].is_null()) {
|
||||
llama.params.antiprompt = body["stop"].get<std::vector<std::string>>();
|
||||
} else {
|
||||
llama.params.antiprompt.clear();
|
||||
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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue