Struct aleph_alpha_client::Sampling
source · [−]pub struct Sampling {
pub temperature: Option<f64>,
pub top_k: Option<u32>,
pub top_p: Option<f64>,
}
Expand description
Sampling controls how the tokens (“words”) are selected for the completion.
Fields
temperature: Option<f64>
A temperature encourages teh model to produce less probable outputs (“be more creative”). Values are expected to be between 0 and 1. Try high values for a more random (“creative”) response.
top_k: Option<u32>
Introduces random sampling for generated tokens by randomly selecting the next token from
the k most likely options. A value larger than 1 encourages the model to be more creative.
Set to 0 to get the same behaviour as None
.
top_p: Option<f64>
Introduces random sampling for generated tokens by randomly selecting the next token from
the smallest possible set of tokens whose cumulative probability exceeds the probability
top_p. Set to 0 to get the same behaviour as None
.
Implementations
sourceimpl Sampling
impl Sampling
sourcepub const MOST_LIKELY: Self = _
pub const MOST_LIKELY: Self = _
Always chooses the token most likely to come next.
Auto Trait Implementations
impl RefUnwindSafe for Sampling
impl Send for Sampling
impl Sync for Sampling
impl Unpin for Sampling
impl UnwindSafe for Sampling
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more