MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / llama_sampler_penalties_clone

Function llama_sampler_penalties_clone

smallthinker/src/llama-sampling.cpp:1689–1705  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1687}
1688
1689static struct llama_sampler * llama_sampler_penalties_clone(const struct llama_sampler * smpl) {
1690 const auto * ctx = (const llama_sampler_penalties *) smpl->ctx;
1691 auto * result = llama_sampler_init_penalties(
1692 ctx->penalty_last_n,
1693 ctx->penalty_repeat,
1694 ctx->penalty_freq,
1695 ctx->penalty_present);
1696
1697 // copy the state
1698 {
1699 auto * result_ctx = (llama_sampler_penalties *) result->ctx;
1700
1701 result_ctx->prev = ctx->prev;
1702 }
1703
1704 return result;
1705}
1706
1707static void llama_sampler_penalties_free(struct llama_sampler * smpl) {
1708 delete (llama_sampler_penalties *) smpl->ctx;

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected