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

Refactor generation sampling parameters (e.g. top k, temperature) into "Sampling" classes #5416

Closed
wants to merge 5 commits into from

Conversation

turtlesoupy
Copy link

#4164 has a full description of the intention here. Basically, to avoid exploding generate(...) with more arguments, I've added one generic Sampler parameter that allows for arbitrary transformations of the generation probability distribution conditioned on the past. This allows users to specify custom ways of sampling (e.g. insert a specific token after a previous one, etc.)

In the process, I've added some basic tests around these samplers; existing tests pass otherwise.

@turtlesoupy turtlesoupy deleted the warp_prob branch June 30, 2020 23:41
@turtlesoupy turtlesoupy restored the warp_prob branch June 30, 2020 23:41
@turtlesoupy
Copy link
Author

(Replaced merge with rebase -- see #5420)

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

Successfully merging this pull request may close these issues.

1 participant