MCPcopy Create free account
hub / github.com/FastFlowLM/FastFlowLM / reset_penalties

Method reset_penalties

src/common/modules/sampler.cpp:64–72  ·  view source on GitHub ↗

\brief Reset the penalties \note The function will reset the penalties \note The function will reset the token positions \note The function will reset the token history \note The function will reset the total tokens \note The function will reset the token positions

Source from the content-addressed store, hash-verified

62/// \note The function will reset the total tokens
63/// \note The function will reset the token positions
64void Sampler::reset_penalties() {
65 for (int i = 0; i < in_features; i++) {
66 this->counters[i] = 0;
67 this->token_positions[i] = -1;
68 }
69 this->token_counts_sparse.clear();
70 this->total_tokens = 0;
71 this->token_history.clear();
72}
73
74void Sampler::softmax_inplace() {
75 if (this->top_k_logits.empty())

Callers 2

clear_contextMethod · 0.80
generateMethod · 0.80

Calls 1

clearMethod · 0.80

Tested by

no test coverage detected