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

Function test_top_p

smallthinker/tests/test-sampling.cpp:97–106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95}
96
97static void test_top_p(const std::vector<float> & probs, const std::vector<float> & probs_expected, float p) {
98 sampler_tester tester(probs, probs_expected);
99
100 DUMP(&tester.cur_p);
101 tester.apply(llama_sampler_init_top_p(p, 0));
102 tester.apply(llama_sampler_init_dist (0));
103 DUMP(&tester.cur_p);
104
105 tester.check();
106}
107
108static void test_min_p(const std::vector<float> & probs, const std::vector<float> & probs_expected, float p) {
109 sampler_tester tester(probs, probs_expected);

Callers 1

mainFunction · 0.70

Calls 4

llama_sampler_init_top_pFunction · 0.85
llama_sampler_init_distFunction · 0.85
applyMethod · 0.45
checkMethod · 0.45

Tested by

no test coverage detected