mirror of
https://github.com/ggml-org/llama.cpp.git
synced 2025-08-13 11:57:43 -04:00
llama : fix empty ring buffer push (#9358)
This commit is contained in:
@@ -1226,7 +1226,9 @@ static struct llama_sampler_i llama_sampler_penalties_i = {
|
||||
/* .name = */ [](const struct llama_sampler * /*smpl*/) { return "penalties"; },
|
||||
/* .accept = */ [](struct llama_sampler * smpl, llama_token token) {
|
||||
auto * ctx = (llama_sampler_penalties *) smpl->ctx;
|
||||
ctx->prev.push_back(token);
|
||||
if (ctx->prev.size()) {
|
||||
ctx->prev.push_back(token);
|
||||
}
|
||||
},
|
||||
/* .apply = */ [](struct llama_sampler * smpl, llama_token_data_array * cur_p) {
|
||||
auto * ctx = (llama_sampler_penalties *) smpl->ctx;
|
||||
|
Reference in New Issue
Block a user