#[non_exhaustive]pub struct NgramSpeculation {
pub ngram_size: i32,
/* private fields */
}Expand description
N-Gram speculation works by trying to find matching tokens in the previous prompt sequence and use those as speculation for generating new tokens.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.ngram_size: i32The number of last N input tokens used as ngram to search/match against the previous prompt sequence. This is equal to the N in N-Gram. The default value is 3 if not specified.
Implementations§
Source§impl NgramSpeculation
impl NgramSpeculation
pub fn new() -> Self
Sourcepub fn set_ngram_size<T: Into<i32>>(self, v: T) -> Self
pub fn set_ngram_size<T: Into<i32>>(self, v: T) -> Self
Sets the value of ngram_size.
Trait Implementations§
Source§impl Clone for NgramSpeculation
impl Clone for NgramSpeculation
Source§fn clone(&self) -> NgramSpeculation
fn clone(&self) -> NgramSpeculation
Returns a copy 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 NgramSpeculation
impl Debug for NgramSpeculation
Source§impl Default for NgramSpeculation
impl Default for NgramSpeculation
Source§fn default() -> NgramSpeculation
fn default() -> NgramSpeculation
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for NgramSpeculationwhere
NgramSpeculation: Default,
impl<'de> Deserialize<'de> for NgramSpeculationwhere
NgramSpeculation: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Message for NgramSpeculation
impl Message for NgramSpeculation
Source§impl PartialEq for NgramSpeculation
impl PartialEq for NgramSpeculation
Source§impl Serialize for NgramSpeculation
impl Serialize for NgramSpeculation
impl StructuralPartialEq for NgramSpeculation
Auto Trait Implementations§
impl Freeze for NgramSpeculation
impl RefUnwindSafe for NgramSpeculation
impl Send for NgramSpeculation
impl Sync for NgramSpeculation
impl Unpin for NgramSpeculation
impl UnwindSafe for NgramSpeculation
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