#[non_exhaustive]pub struct SpeculativeDecodingSpec {
pub speculative_token_count: i32,
pub speculation: Option<Speculation>,
/* private fields */
}Expand description
Configuration for Speculative Decoding.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.speculative_token_count: i32The number of speculative tokens to generate at each step.
speculation: Option<Speculation>The type of speculation method to use.
Implementations§
Source§impl SpeculativeDecodingSpec
impl SpeculativeDecodingSpec
pub fn new() -> Self
Sourcepub fn set_speculative_token_count<T: Into<i32>>(self, v: T) -> Self
pub fn set_speculative_token_count<T: Into<i32>>(self, v: T) -> Self
Sets the value of speculative_token_count.
Sourcepub fn set_speculation<T: Into<Option<Speculation>>>(self, v: T) -> Self
pub fn set_speculation<T: Into<Option<Speculation>>>(self, v: T) -> Self
Sets the value of speculation.
Note that all the setters affecting speculation are mutually
exclusive.
Sourcepub fn draft_model_speculation(&self) -> Option<&Box<DraftModelSpeculation>>
pub fn draft_model_speculation(&self) -> Option<&Box<DraftModelSpeculation>>
The value of speculation
if it holds a DraftModelSpeculation, None if the field is not set or
holds a different branch.
Sourcepub fn set_draft_model_speculation<T: Into<Box<DraftModelSpeculation>>>(
self,
v: T,
) -> Self
pub fn set_draft_model_speculation<T: Into<Box<DraftModelSpeculation>>>( self, v: T, ) -> Self
Sets the value of speculation
to hold a DraftModelSpeculation.
Note that all the setters affecting speculation are
mutually exclusive.
Sourcepub fn ngram_speculation(&self) -> Option<&Box<NgramSpeculation>>
pub fn ngram_speculation(&self) -> Option<&Box<NgramSpeculation>>
The value of speculation
if it holds a NgramSpeculation, None if the field is not set or
holds a different branch.
Sourcepub fn set_ngram_speculation<T: Into<Box<NgramSpeculation>>>(self, v: T) -> Self
pub fn set_ngram_speculation<T: Into<Box<NgramSpeculation>>>(self, v: T) -> Self
Sets the value of speculation
to hold a NgramSpeculation.
Note that all the setters affecting speculation are
mutually exclusive.
Trait Implementations§
Source§impl Clone for SpeculativeDecodingSpec
impl Clone for SpeculativeDecodingSpec
Source§fn clone(&self) -> SpeculativeDecodingSpec
fn clone(&self) -> SpeculativeDecodingSpec
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more