pub struct FixedDistTargetModel { /* private fields */ }Expand description
Target model returning the same categorical distribution for every position.
Implementations§
Source§impl FixedDistTargetModel
impl FixedDistTargetModel
Sourcepub fn new(probs: Vec<f64>) -> SpeculativeDecodingResult<Self>
pub fn new(probs: Vec<f64>) -> SpeculativeDecodingResult<Self>
Build a mock target from a linear-space probability vector. See
FixedDistDraftModel::new for invariants.
Trait Implementations§
Source§impl Clone for FixedDistTargetModel
impl Clone for FixedDistTargetModel
Source§fn clone(&self) -> FixedDistTargetModel
fn clone(&self) -> FixedDistTargetModel
Returns a duplicate of the value. Read more
1.0.0 · 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 FixedDistTargetModel
impl Debug for FixedDistTargetModel
Source§impl TargetModel for FixedDistTargetModel
impl TargetModel for FixedDistTargetModel
Source§fn vocab_size(&self) -> usize
fn vocab_size(&self) -> usize
Vocabulary cardinality the target emits log-probs over. Must match
the draft’s
vocab_size().Source§fn verify(
&self,
_prefix: &[TokenId],
draft_tokens: &[TokenId],
) -> SpeculativeDecodingResult<TargetScores>
fn verify( &self, _prefix: &[TokenId], draft_tokens: &[TokenId], ) -> SpeculativeDecodingResult<TargetScores>
Score
prefix concatenated with draft_tokens: return k + 1
distributions (the k draft-covered positions plus the bonus).Auto Trait Implementations§
impl Freeze for FixedDistTargetModel
impl RefUnwindSafe for FixedDistTargetModel
impl Send for FixedDistTargetModel
impl Sync for FixedDistTargetModel
impl Unpin for FixedDistTargetModel
impl UnsafeUnpin for FixedDistTargetModel
impl UnwindSafe for FixedDistTargetModel
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