llama_cpp_sys_4::common

Struct common_sampler_params

Source
#[repr(C)]
pub struct common_sampler_params {
Show 32 fields pub seed: u32, pub n_prev: i32, pub n_probs: i32, pub min_keep: i32, pub top_k: i32, pub top_p: f32, pub min_p: f32, pub xtc_probability: f32, pub xtc_threshold: f32, pub tfs_z: f32, pub typ_p: f32, pub temp: f32, pub dynatemp_range: f32, pub dynatemp_exponent: f32, pub penalty_last_n: i32, pub penalty_repeat: f32, pub penalty_freq: f32, pub penalty_present: f32, pub dry_multiplier: f32, pub dry_base: f32, pub dry_allowed_length: i32, pub dry_penalty_last_n: i32, pub mirostat: i32, pub mirostat_tau: f32, pub mirostat_eta: f32, pub penalize_nl: bool, pub ignore_eos: bool, pub no_perf: bool, pub dry_sequence_breakers: Vec<String>, pub samplers: Vec<common_sampler_type>, pub grammar: Vec<String>, pub logit_bias: Vec<(i32, f64)>,
}
Expand description

common sampler params

Fields§

§seed: u32

the seed used to initialize llama_sampler

§n_prev: i32

number of previous tokens to remember

§n_probs: i32

if greater than 0, output the probabilities of top n_probs tokens.

§min_keep: i32

0 = disabled, otherwise samplers should return at least min_keep tokens

§top_k: i32

<= 0 to use vocab size

§top_p: f32

1.0 = disabled

§min_p: f32

0.0 = disabled

§xtc_probability: f32

0.0 = disabled

§xtc_threshold: f32

0.5 disables XTC

§tfs_z: f32

1.0 = disabled

§typ_p: f32

typical_p, 1.0 = disabled

§temp: f32

<= 0.0 to sample greedily, 0.0 to not output probabilities

§dynatemp_range: f32

0.0 = disabled

§dynatemp_exponent: f32

controls how entropy maps to temperature in dynamic temperature sampler

§penalty_last_n: i32

last n tokens to penalize (0 = disable penalty, -1 = context size)

§penalty_repeat: f32

1.0 = disabled

§penalty_freq: f32

0.0 = disabled

§penalty_present: f32

0.0 = disabled

§dry_multiplier: f32

0.0 = disabled; DRY repetition penalty for tokens extending repetition:

§dry_base: f32

0.0 = disabled; multiplier * base ^ (length of sequence before token - allowed length)

§dry_allowed_length: i32

tokens extending repetitions beyond this receive penalty

§dry_penalty_last_n: i32

how many tokens to scan for repetitions (0 = disable penalty, -1 = context size)

§mirostat: i32

0 = disabled, 1 = mirostat, 2 = mirostat 2.0

§mirostat_tau: f32

target entropy

§mirostat_eta: f32

learning rate

§penalize_nl: bool

consider newlines as a repeatable token

§ignore_eos: bool§no_perf: bool

disable performance metrics

§dry_sequence_breakers: Vec<String>§samplers: Vec<common_sampler_type>§grammar: Vec<String>§logit_bias: Vec<(i32, f64)>

Trait Implementations§

Source§

impl Debug for common_sampler_params

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for common_sampler_params

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for common_sampler_params

Source§

fn eq(&self, other: &common_sampler_params) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for common_sampler_params

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.