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

Function llama_sampler_init_mirostat

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

Source from the content-addressed store, hash-verified

1299};
1300
1301struct llama_sampler * llama_sampler_init_mirostat(int32_t n_vocab, uint32_t seed, float tau, float eta, int32_t m) {
1302 auto seed_cur = get_rng_seed(seed);
1303 return llama_sampler_init(
1304 /* .iface = */ &llama_sampler_mirostat_i,
1305 /* .ctx = */ new llama_sampler_mirostat {
1306 /* .n_vocab = */ n_vocab,
1307 /* .seed = */ seed,
1308 /* .seed_cur = */ seed_cur,
1309 /* .tau = */ tau,
1310 /* .eta = */ eta,
1311 /* .m = */ m,
1312 /* .mu = */ 2.0f*tau,
1313 /* .rng = */ std::mt19937(seed_cur),
1314 }
1315 );
1316}
1317
1318// mirostat v2
1319

Callers 2

common_sampler_initFunction · 0.85

Calls 2

get_rng_seedFunction · 0.85
llama_sampler_initFunction · 0.85

Tested by

no test coverage detected