[−][src]Struct rust_bert::pipelines::generation::GenerateConfig
Fields
model_resource: Resource
Model weights resource (default: pretrained GPT2 model)
config_resource: Resource
Config resource (default: pretrained GPT2 model)
vocab_resource: Resource
Vocab resource (default: pretrained GPT2 model)
merges_resource: Resource
Merges resource (default: pretrained GPT2 model)
min_length: u64
Minimum sequence length (default: 0)
max_length: u64
Maximum sequence length (default: 20)
do_sample: bool
Sampling flag. If true, will perform top-k and/or nucleus sampling on generated tokens, otherwise greedy (deterministic) decoding (default: true)
early_stopping: bool
Early stopping flag indicating if the beam search should stop as soon as num_beam
hypotheses have been generated (default: false)
num_beams: u64
Number of beams for beam search (default: 5)
temperature: f64
Temperature setting. Values higher than 1 will improve originality at the risk of reducing relevance (default: 1.0)
top_k: u64
Top_k values for sampling tokens. Value higher than 0 will enable the feature (default: 0)
top_p: f64
Top_p value for Nucleus sampling, Holtzman et al.. Keep top tokens until cumulative probability reaches top_p (default: 0.9)
repetition_penalty: f64
Repetition penalty (mostly useful for CTRL decoders). Values higher than 1 will penalize tokens that have been already generated. (default: 1.0)
length_penalty: f64
Exponential penalty based on the length of the hypotheses generated (default: 1.0)
no_repeat_ngram_size: u64
Number of allowed repetitions of n-grams. Values higher than 0 turn on this feature (default: 3)
num_return_sequences: u64
Number of sequences to return for each prompt text (default: 1)
device: Device
Device to place the model on (default: CUDA/GPU when available)
Trait Implementations
impl Default for GenerateConfig
[src]
fn default() -> GenerateConfig
[src]
Auto Trait Implementations
impl RefUnwindSafe for GenerateConfig
impl Send for GenerateConfig
impl Sync for GenerateConfig
impl Unpin for GenerateConfig
impl UnwindSafe for GenerateConfig
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,