mindformers.generation¶
Mindformers generation.
mindformers.generation.generation_config¶
Class that holds a configuration for a generation task. Args: > Parameters that control the length of the output. |
mindformers.generation.logits_process¶
Abstract base class for all logit processors that can be applied during generation. |
|
Abstract base class for all logit warpers that can be applied during generation with multinomial sampling. |
|
This class can be used to create a list of [LogitsProcessor] or [LogitsWarper] to subsequently process a scores input tensor. |
|
|
[LogitsProcessor] enforcing an exponential penalty on repeated sequences. |
[LogitsWarper] and [LogitsProcessor] for normalizing the scores using log-softmax. |
|
|
[LogitsWarper] for temperature (exponential scaling output probability distribution). |
[LogitsWarper] that performs top-k, i.e. restricting to the k highest probability elements. |
|
[LogitsWarper] that performs top-p, i.e. restricting to top tokens summing to prob_cut_off <= prob_cut_off. |
mindformers.generation.streamers¶
Base class from which .generate() streamers should inherit. |
|
Simple text streamer that prints the token(s) to stdout as soon as entire words are formed. |
|
Streamer that stores print-ready text in a queue, to be used by a downstream application as an iterator. |
mindformers.generation.text_generator¶
Generator For the nlp models |