log sampler init values
This commit is contained in:
parent
1c58e9a96a
commit
4e04bd1ce2
|
|
@ -2466,16 +2466,19 @@ struct llama_sampler * llama_sampler_init_power_law(
|
||||||
float decay,
|
float decay,
|
||||||
uint32_t seed
|
uint32_t seed
|
||||||
) {
|
) {
|
||||||
|
const float _decay = std::min(decay, 0.99f);
|
||||||
|
fprintf(stderr, "power-law: init: target %.3f, decay %.3f\n", (double)target, (double)_decay);
|
||||||
|
fflush(stderr);
|
||||||
auto seed_cur = get_rng_seed(seed);
|
auto seed_cur = get_rng_seed(seed);
|
||||||
return llama_sampler_init(
|
return llama_sampler_init(
|
||||||
/* .iface = */ &llama_sampler_power_law_i,
|
/* .iface = */ &llama_sampler_power_law_i,
|
||||||
/* .ctx = */ new llama_sampler_power_law {
|
/* .ctx = */ new llama_sampler_power_law {
|
||||||
/* .target = */ target,
|
/* .target = */ target,
|
||||||
/* .decay = */ std::min(decay, 0.99f),
|
/* .decay = */ _decay,
|
||||||
/* .seed = */ seed_cur,
|
/* .seed = */ seed_cur,
|
||||||
/* .rng = */ std::mt19937(seed_cur),
|
/* .rng = */ std::mt19937(seed_cur),
|
||||||
/* .weighted_sum = */ 0.0f,
|
/* .weighted_sum = */ 0.0f,
|
||||||
/* .total_weight = */ 0.0f,
|
/* .total_weight = */ 0.0f,
|
||||||
/* .original_probs = */ {},
|
/* .original_probs = */ {},
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue