Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
EricLBuehler committed Apr 2, 2024
1 parent fc0dfd9 commit 3d5b552
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/logits_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,9 @@ impl LogitsProcessor {
}
}

if top_p <= 0.0 || top_p >= 1.0 {
return self.sample_multinomial(probs);
}
// TOP P
// top-p sampling (or "nucleus sampling") samples from the smallest set of
// tokens that exceed probability top_p. This way we never sample tokens that
Expand Down

0 comments on commit 3d5b552

Please sign in to comment.