torchtune.generation¶
| Generates tokens from a model conditioned on a prompt, and also returns logits for the generations. | |
| Generates the next tokens given a prompt, and also returns the corresponding logits. | |
| Generic sample from a probability distribution. | |
| Converts a padding mask of shape  | |
| Calculates position ids given a padding mask which right-shifts position ids to start from the first valid token. |