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

Function llama_sampler_init_penalties

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

Source from the content-addressed store, hash-verified

1718};
1719
1720struct llama_sampler * llama_sampler_init_penalties(
1721 int32_t penalty_last_n,
1722 float penalty_repeat,
1723 float penalty_freq,
1724 float penalty_present) {
1725 penalty_last_n = std::max(penalty_last_n, 0);
1726
1727 return llama_sampler_init(
1728 /* .iface = */ &llama_sampler_penalties_i,
1729 /* .ctx = */ new llama_sampler_penalties {
1730 /* .penalty_last_n = */ penalty_last_n,
1731 /* .penalty_repeat = */ penalty_repeat,
1732 /* .penalty_freq = */ penalty_freq,
1733 /* .penalty_present = */ penalty_present,
1734 /* .prev = */ ring_buffer<llama_token>(penalty_last_n),
1735 /* .token_count = */ {},
1736 }
1737 );
1738}
1739
1740// top-n-sigma
1741

Callers 3

test_penaltiesFunction · 0.85
common_sampler_initFunction · 0.85

Calls 2

maxFunction · 0.85
llama_sampler_initFunction · 0.85

Tested by 1

test_penaltiesFunction · 0.68