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

Function llama_sampler_mirostat_v2_clone

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

Source from the content-addressed store, hash-verified

1369}
1370
1371static struct llama_sampler * llama_sampler_mirostat_v2_clone(const struct llama_sampler * smpl) {
1372 const auto * ctx = (const llama_sampler_mirostat_v2 *) smpl->ctx;
1373
1374 auto * result = llama_sampler_init_mirostat_v2(ctx->seed, ctx->tau, ctx->eta);
1375
1376 // copy the state
1377 {
1378 auto * result_ctx = (llama_sampler_mirostat_v2 *) result->ctx;
1379
1380 result_ctx->mu = ctx->mu;
1381 result_ctx->rng = ctx->rng;
1382 }
1383
1384 return result;
1385}
1386
1387static void llama_sampler_mirostat_v2_free(struct llama_sampler * smpl) {
1388 delete (llama_sampler_mirostat_v2 *) smpl->ctx;

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected