\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
| 62 | /// \note The function will reset the total tokens |
| 63 | /// \note The function will reset the token positions |
| 64 | void 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 | |
| 74 | void Sampler::softmax_inplace() { |
| 75 | if (this->top_k_logits.empty()) |
no test coverage detected