| 1159 | } |
| 1160 | |
| 1161 | static struct llama_sampler * llama_sampler_xtc_clone(const struct llama_sampler * smpl) { |
| 1162 | const auto * ctx = (const llama_sampler_xtc *) smpl->ctx; |
| 1163 | auto * result = llama_sampler_init_xtc(ctx->probability, ctx->threshold, ctx->min_keep, ctx->seed); |
| 1164 | |
| 1165 | // copy the state |
| 1166 | { |
| 1167 | auto * result_ctx = (llama_sampler_xtc *) result->ctx; |
| 1168 | |
| 1169 | result_ctx->rng = ctx->rng; |
| 1170 | } |
| 1171 | |
| 1172 | return result; |
| 1173 | } |
| 1174 | |
| 1175 | static void llama_sampler_xtc_free(struct llama_sampler * smpl) { |
| 1176 | delete (llama_sampler_xtc *) smpl->ctx; |
nothing calls this directly
no test coverage detected