| 1687 | } |
| 1688 | |
| 1689 | static 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 | |
| 1707 | static void llama_sampler_penalties_free(struct llama_sampler * smpl) { |
| 1708 | delete (llama_sampler_penalties *) smpl->ctx; |
nothing calls this directly
no test coverage detected