pub struct SpeculativeOptions {
pub max_new_tokens: usize,
pub start_pos: usize,
pub sampling: SamplingParams,
pub seed: u64,
}Expand description
Everything speculative_decode_with needs beyond the model, the
prompt and the drafter.
Fields§
§max_new_tokens: usize§start_pos: usizeAbsolute position of the first prompt_tokens token in the KV
cache: 0 for a fresh cache, cache.seq_len when resuming a
warm one (a prefix-cache hit, or a second call continuing the
first). Every position and every rollback length inside the
decode loop is absolute, so a non-zero base is not a special
case – see rolls_back_to_absolute_positions_on_a_warm_cache.
sampling: SamplingParamsThe sampling configuration the target model would have used
without speculation. Verification is lossless with respect to
exactly these parameters (see accept_or_resample).
seed: u64Trait Implementations§
Source§impl Clone for SpeculativeOptions
impl Clone for SpeculativeOptions
Source§fn clone(&self) -> SpeculativeOptions
fn clone(&self) -> SpeculativeOptions
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 moreSource§impl Debug for SpeculativeOptions
impl Debug for SpeculativeOptions
Source§impl Default for SpeculativeOptions
impl Default for SpeculativeOptions
Source§fn default() -> SpeculativeOptions
fn default() -> SpeculativeOptions
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SpeculativeOptions
impl RefUnwindSafe for SpeculativeOptions
impl Send for SpeculativeOptions
impl Sync for SpeculativeOptions
impl Unpin for SpeculativeOptions
impl UnsafeUnpin for SpeculativeOptions
impl UnwindSafe for SpeculativeOptions
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more