Skip to content

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

Closed
turtlesoupy wants to merge 5 commits into
huggingface:masterfrom
turtlesoupy:warp_prob
Closed

Refactor generation sampling parameters (e.g. top k, temperature) into "Sampling" classes#5416
turtlesoupy wants to merge 5 commits into
huggingface:masterfrom
turtlesoupy:warp_prob

Conversation

@turtlesoupy

Copy link
Copy Markdown

#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
Copy Markdown
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