server : ignore empty stop strings (#32093)

This commit is contained in:
Roshan Kumar authored and GitHub committed 2026-11-15 17:23:05 +01:00
1 parent b54752df40
commit 56fd8a375f
5 files changed
+59 -2

No files matched your search

+2 -2
View File
@@ -458,9 +458,9 @@ std::vector<std::unique_ptr<field>> make_llama_cmpl_schema(const common_params &
const auto & stop = data.at("stop");
if (stop.is_array()) {
for (const auto & word : stop) {
if (!word.empty()) ctx.params.antiprompt.push_back(word);
if (!word.empty() && word != "") ctx.params.antiprompt.push_back(word);
}
} else if (stop.is_string()) {
} else if (stop.is_string() && stop != "") {
ctx.params.antiprompt.push_back(stop.get<std::string>());
}
// fall back to CLI defaults if the request provided no effective stop strings