Struct llm_base::InferenceParameters
source · pub struct InferenceParameters {
pub n_threads: usize,
pub n_batch: usize,
pub top_k: usize,
pub top_p: f32,
pub repeat_penalty: f32,
pub temperature: f32,
pub bias_tokens: TokenBias,
}Expand description
The parameters that drive text generation.
Fields§
§n_threads: usizeThe number of threads to use.
n_batch: usizeControls batch/chunk size for prompt ingestion in InferenceSession::feed_prompt.
top_k: usizeThe top K words by score are kept during sampling.
top_p: f32The cumulative probability after which no more words are kept for sampling.
repeat_penalty: f32The penalty for repeating tokens. Higher values make the generation less likely to get into a loop, but may harm results when repetitive outputs are desired.
temperature: f32Temperature (randomness) used for sampling. A higher number is more random.
bias_tokens: TokenBiasA list of tokens to bias against in the process of generation.
Trait Implementations§
source§impl Clone for InferenceParameters
impl Clone for InferenceParameters
source§fn clone(&self) -> InferenceParameters
fn clone(&self) -> InferenceParameters
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 InferenceParameters
impl Debug for InferenceParameters
source§impl Default for InferenceParameters
impl Default for InferenceParameters
source§impl PartialEq<InferenceParameters> for InferenceParameters
impl PartialEq<InferenceParameters> for InferenceParameters
source§fn eq(&self, other: &InferenceParameters) -> bool
fn eq(&self, other: &InferenceParameters) -> bool
This method tests for
self and other values to be equal, and is used
by ==.impl StructuralPartialEq for InferenceParameters
Auto Trait Implementations§
impl RefUnwindSafe for InferenceParameters
impl Send for InferenceParameters
impl Sync for InferenceParameters
impl Unpin for InferenceParameters
impl UnwindSafe for InferenceParameters
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