pub struct Branch<S> {
pub sample_mask: Option<S>,
pub temperature: Option<f32>,
pub splices: Vec<Splice>,
}Fields§
§sample_mask: Option<S>If None, no sampling is performed. If Some(set), only tokens from the set are allowed.
temperature: Option<f32>Override temperature for sampling. It may or may not be sticky.
splices: Vec<Splice>Describes what to do after sampling.
If no sampling, there should be exactly one splice, with empty when_sampled.
Implementations§
Source§impl<S> Branch<S>
impl<S> Branch<S>
pub fn map_mask<F, T>(&self, f: F) -> Branch<T>
pub fn find_splice(&self, sampled: TokenId) -> Option<&Splice>
pub fn spliced(&self, sampled: TokenId) -> Splice
pub fn unconditional_splice(&self) -> Option<&Splice>
pub fn has_backtrack(&self) -> bool
pub fn has_ff_tokens(&self) -> bool
pub fn stop() -> Self
pub fn is_stop(&self) -> bool
pub fn splice(backtrack: u32, ff_tokens: Vec<TokenId>) -> Self
pub fn noop() -> Self
pub fn sample(set: S, temperature: Option<f32>) -> Self
Trait Implementations§
Source§impl<'de, S> Deserialize<'de> for Branch<S>where
S: Deserialize<'de>,
impl<'de, S> Deserialize<'de> for Branch<S>where
S: Deserialize<'de>,
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
Auto Trait Implementations§
impl<S> Freeze for Branch<S>where
S: Freeze,
impl<S> RefUnwindSafe for Branch<S>where
S: RefUnwindSafe,
impl<S> Send for Branch<S>where
S: Send,
impl<S> Sync for Branch<S>where
S: Sync,
impl<S> Unpin for Branch<S>where
S: Unpin,
impl<S> UnwindSafe for Branch<S>where
S: UnwindSafe,
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