Skip to content

Commit

Permalink
set cuttoff in sample_topp to the practical value 0.001
Browse files Browse the repository at this point in the history
  • Loading branch information
Majdoddin committed Aug 17, 2023
1 parent bd18228 commit 9253c18
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion run.c
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ int sample_topp(float* probabilities, int n, float topp, ProbIndex* probindex) {
// quicksort indices in descending order of probabilities
// values smaller than (1 - topp) / (n - 1) cannot be part of the result
// so for efficiency we crop these out as candidates before sorting
const float cutoff = (1.0f - topp) / (n - 1);
const float cutoff = 0.001; //a practical lowerbound for the probabilities that get sampled
for (int i = 0; i < n; i++) {
if (probabilities[i] >= cutoff) {
probindex[n0].index = i;
Expand Down

0 comments on commit 9253c18

Please sign in to comment.