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

Function llama_sampler_mirostat_clone

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

Source from the content-addressed store, hash-verified

1264}
1265
1266static struct llama_sampler * llama_sampler_mirostat_clone(const struct llama_sampler * smpl) {
1267 const auto * ctx = (const llama_sampler_mirostat *) smpl->ctx;
1268 auto * result = llama_sampler_init_mirostat(ctx->n_vocab, ctx->seed, ctx->tau, ctx->eta, ctx->m);
1269
1270 // copy the state
1271 {
1272 auto * result_ctx = (llama_sampler_mirostat *) smpl->ctx;
1273
1274 result_ctx->mu = ctx->mu;
1275 result_ctx->rng = ctx->rng;
1276 }
1277
1278 return result;
1279}
1280
1281static void llama_sampler_mirostat_reset(struct llama_sampler * smpl) {
1282 auto * ctx = (llama_sampler_mirostat *) smpl->ctx;

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected