import TensorUtils
Coverage
Declarations
Interfaces
protocol LogitsWarper
Protocol for all logit warpers that can be applied during generation
struct LogitsProcessor
struct Math
From M.I. Hollemans
struct RepetitionPenaltyWarper
RepetitionPenaltyWarper prevents the repetition of previous tokens through a penalty. This penalty is applied at most once per token. https://github.com/huggingface/transformers/blob/main/src/transformers/generation/logits_process.py#L294
RepetitionPenaltyWarper
struct TemperatureLogitsWarper
struct TopKLogitsWarper
Top-K. Select the k most-probable element indices from arr and return both the indices (from the original array) and their probabilities.
arr
struct TopPLogitsWarper
Top-P. Select the smallest set of elements whose cumulative probability exceeds the probability p. Based on https://gist.github.com/thomwolf/1a5a29f6962089e871b94cbd09daf317
p
struct Weights
import Generation
import Hub
import HubCLI
import Models
import Tokenizers
import TransformersCLI