pub struct TopKConfig {
pub k: usize,
pub temperature: f64,
}Expand description
Configuration for top_k_sample and top_k_sample_batch.
Fields§
§k: usizeNumber of highest-probability tokens to keep (k ≥ 1).
temperature: f64Softmax temperature (> 0). Higher values flatten the
distribution, lower values sharpen it.
Trait Implementations§
Source§impl Clone for TopKConfig
impl Clone for TopKConfig
Source§fn clone(&self) -> TopKConfig
fn clone(&self) -> TopKConfig
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 TopKConfig
Source§impl Debug for TopKConfig
impl Debug for TopKConfig
Auto Trait Implementations§
impl Freeze for TopKConfig
impl RefUnwindSafe for TopKConfig
impl Send for TopKConfig
impl Sync for TopKConfig
impl Unpin for TopKConfig
impl UnsafeUnpin for TopKConfig
impl UnwindSafe for TopKConfig
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