Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small issue in nucleus sampling explanation + implementation #203

Open
ascher8 opened this issue Aug 10, 2023 · 0 comments
Open

Small issue in nucleus sampling explanation + implementation #203

ascher8 opened this issue Aug 10, 2023 · 0 comments

Comments

@ascher8
Copy link

ascher8 commented Aug 10, 2023

In the file <labml_nn/sampling/nucleus.py> there seem to be two issues.
"That is, we pick the highest probable tokens until the sum of their probabilities is less that $p$." should be more than
And in the code implementation, line 62 should be flipped to a >= from what it is currently:
nucleus = cum_sum_probs < self.p

I'm new to github and just learned what nucleus sampling is 10 minutes ago, so sorry if this Issue was improperly formatted or wrong or anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant