Skip to content

Commit 5107e8c

Browse files
authored
DRY: Fixes clone functionality (ggml-org#10192)
1 parent 2319126 commit 5107e8c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/llama-sampling.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1876,8 +1876,11 @@ static void llama_sampler_dry_reset(struct llama_sampler * smpl) {
18761876
static struct llama_sampler * llama_sampler_dry_clone(const struct llama_sampler * smpl) {
18771877
const auto * ctx = (llama_sampler_dry *) smpl->ctx;
18781878

1879-
// nullptr is passed as vocab because it is only needed for raw sequence breaker processing, which we have already done and will be copying
1880-
auto * result = llama_sampler_init_dry(nullptr, ctx->dry_multiplier, ctx->dry_base, ctx->dry_allowed_length, ctx->dry_penalty_last_n, NULL, 0);
1879+
llama_vocab dummy_vocab;
1880+
1881+
// dummy vocab is passed because it is only needed for raw sequence breaker processing, which we have already done and will simply be copying
1882+
auto * result = llama_sampler_init_dry_impl(dummy_vocab, ctx->total_context_size, ctx->dry_multiplier, ctx->dry_base, ctx->dry_allowed_length, ctx->dry_penalty_last_n, NULL, 0);
1883+
18811884
// Copy the state, including the processed breakers
18821885
{
18831886
auto * result_ctx = (llama_sampler_dry *) result->ctx;

0 commit comments

Comments
 (0)