pub struct ContrastiveConfig {
pub k: usize,
pub alpha: f32,
pub max_len: usize,
}Expand description
Configuration for contrastive search decoding.
§Fields
k— top-k candidates to consider at each step (≥ 1).alpha— degeneration penalty weight∈ [0, 1].α = 0reduces to greedy decoding;α = 1ignores model probability entirely.max_len— maximum number of tokens to generate.
Fields§
§k: usizeNumber of top-probability candidates to consider at each step.
alpha: f32Degeneration penalty weight ∈ [0, 1].
max_len: usizeMaximum generation length (number of tokens produced).
Trait Implementations§
Source§impl Clone for ContrastiveConfig
impl Clone for ContrastiveConfig
Source§fn clone(&self) -> ContrastiveConfig
fn clone(&self) -> ContrastiveConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ContrastiveConfig
Source§impl Debug for ContrastiveConfig
impl Debug for ContrastiveConfig
Auto Trait Implementations§
impl Freeze for ContrastiveConfig
impl RefUnwindSafe for ContrastiveConfig
impl Send for ContrastiveConfig
impl Sync for ContrastiveConfig
impl Unpin for ContrastiveConfig
impl UnsafeUnpin for ContrastiveConfig
impl UnwindSafe for ContrastiveConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more