Module sampling

Source
Expand description

Utilities for sampling from model outputs

Functionsยง

greedy_sample
Greedy sampling - always return the most likely token
sample_top_k
Top-k sampling - sample from the k most likely tokens
sample_with_temperature
Sample a token using temperature scaling