Skip to main content

CommonParams

Struct CommonParams 

Source
pub struct CommonParams {
Show 20 fields pub n_predict: i32, pub n_ctx: i32, pub n_batch: i32, pub n_ubatch: i32, pub n_keep: i32, pub n_chunks: i32, pub n_parallel: i32, pub n_sequences: i32, pub grp_attn_n: i32, pub grp_attn_w: i32, pub n_print: i32, pub rope_freq_base: f32, pub rope_freq_scale: f32, pub yarn_ext_factor: f32, pub yarn_attn_factor: f32, pub yarn_beta_fast: f32, pub yarn_beta_slow: f32, pub yarn_orig_ctx: i32, pub defrag_thold: f32, pub prompt: String,
}
Expand description

Struct containing common parameters for processing.

§See more

https://github.com/ggerganov/llama.cpp/blob/master/common/common.h#L109

Fields§

§n_predict: i32

New tokens to predict

§n_ctx: i32

Context size

§n_batch: i32

Logical batch size for prompt processing (must be >=32 to use BLAS)

§n_ubatch: i32

Physical batch size for prompt processing (must be >=32 to use BLAS)

§n_keep: i32

Number of tokens to keep from initial prompt

§n_chunks: i32

Max number of chunks to process (-1 = unlimited)

§n_parallel: i32

Number of parallel sequences to decode

§n_sequences: i32

Number of sequences to decode

§grp_attn_n: i32

Group-attention factor

§grp_attn_w: i32

Group-attention width

§n_print: i32

Print token count every n tokens (-1 = disabled)

§rope_freq_base: f32

RoPE base frequency

§rope_freq_scale: f32

RoPE frequency scaling factor

§yarn_ext_factor: f32

YaRN extrapolation mix factor

§yarn_attn_factor: f32

YaRN magnitude scaling factor

§yarn_beta_fast: f32

YaRN low correction dim

§yarn_beta_slow: f32

YaRN high correction dim

§yarn_orig_ctx: i32

YaRN original context length

§defrag_thold: f32

KV cache defragmentation threshold

§prompt: String

prompt for the model to consume

Trait Implementations§

Source§

impl Clone for CommonParams

Source§

fn clone(&self) -> CommonParams

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CommonParams

Source§

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

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

impl Default for CommonParams

Source§

fn default() -> Self

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

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<T> WithSubscriber for T

Source§

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
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more