Skip to main content

LlamaContextParams

Struct LlamaContextParams 

Source
pub struct LlamaContextParams {
    pub context_params: llama_context_params,
}

Fields§

§context_params: llama_context_params

Implementations§

Source§

impl LlamaContextParams

Source

pub fn with_n_ctx(self, n_ctx: Option<NonZeroU32>) -> Self

Source

pub const fn n_ctx(&self) -> Option<NonZeroU32>

Source

pub const fn with_n_batch(self, n_batch: u32) -> Self

Source

pub const fn n_batch(&self) -> u32

Source

pub const fn with_n_ubatch(self, n_ubatch: u32) -> Self

Source

pub const fn n_ubatch(&self) -> u32

Source

pub const fn with_flash_attention_policy( self, policy: llama_flash_attn_type, ) -> Self

Source

pub const fn flash_attention_policy(&self) -> llama_flash_attn_type

Source

pub const fn with_offload_kqv(self, enabled: bool) -> Self

Source

pub const fn offload_kqv(&self) -> bool

Source

pub fn with_rope_scaling_type(self, rope_scaling_type: RopeScalingType) -> Self

Source

pub fn rope_scaling_type(&self) -> RopeScalingType

Source

pub const fn with_rope_freq_base(self, rope_freq_base: f32) -> Self

Source

pub const fn rope_freq_base(&self) -> f32

Source

pub const fn with_rope_freq_scale(self, rope_freq_scale: f32) -> Self

Source

pub const fn rope_freq_scale(&self) -> f32

Source

pub const fn n_threads(&self) -> i32

Source

pub const fn n_threads_batch(&self) -> i32

Source

pub const fn with_n_threads(self, n_threads: i32) -> Self

Source

pub const fn with_n_threads_batch(self, n_threads: i32) -> Self

Source

pub const fn embeddings(&self) -> bool

Source

pub const fn with_embeddings(self, embedding: bool) -> Self

Source

pub fn with_cb_eval(self, cb_eval: ggml_backend_sched_eval_callback) -> Self

Source

pub const fn with_cb_eval_user_data( self, cb_eval_user_data: *mut c_void, ) -> Self

Source

pub fn with_pooling_type(self, pooling_type: LlamaPoolingType) -> Self

Source

pub fn pooling_type(&self) -> LlamaPoolingType

Source

pub const fn with_swa_full(self, enabled: bool) -> Self

Source

pub const fn swa_full(&self) -> bool

Source

pub const fn with_n_seq_max(self, n_seq_max: u32) -> Self

Source

pub const fn n_seq_max(&self) -> u32

Source

pub fn with_type_k(self, type_k: KvCacheType) -> Self

Source

pub fn type_k(&self) -> KvCacheType

Source

pub fn with_type_v(self, type_v: KvCacheType) -> Self

Source

pub fn type_v(&self) -> KvCacheType

Source

pub fn with_attention_type(self, attention_type: LlamaAttentionType) -> Self

Source

pub fn attention_type(&self) -> LlamaAttentionType

Source

pub const fn with_yarn_ext_factor(self, yarn_ext_factor: f32) -> Self

Source

pub const fn yarn_ext_factor(&self) -> f32

Source

pub const fn with_yarn_attn_factor(self, yarn_attn_factor: f32) -> Self

Source

pub const fn yarn_attn_factor(&self) -> f32

Source

pub const fn with_yarn_beta_fast(self, yarn_beta_fast: f32) -> Self

Source

pub const fn yarn_beta_fast(&self) -> f32

Source

pub const fn with_yarn_beta_slow(self, yarn_beta_slow: f32) -> Self

Source

pub const fn yarn_beta_slow(&self) -> f32

Source

pub const fn with_yarn_orig_ctx(self, yarn_orig_ctx: u32) -> Self

Source

pub const fn yarn_orig_ctx(&self) -> u32

Source

pub const fn with_defrag_thold(self, defrag_thold: f32) -> Self

Source

pub const fn defrag_thold(&self) -> f32

Source

pub const fn with_no_perf(self, no_perf: bool) -> Self

Source

pub const fn no_perf(&self) -> bool

Source

pub const fn with_op_offload(self, op_offload: bool) -> Self

Source

pub const fn op_offload(&self) -> bool

Source

pub const fn with_kv_unified(self, kv_unified: bool) -> Self

Source

pub const fn kv_unified(&self) -> bool

Trait Implementations§

Source§

impl Clone for LlamaContextParams

Source§

fn clone(&self) -> LlamaContextParams

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for LlamaContextParams

Source§

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

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

impl Default for LlamaContextParams

Source§

fn default() -> Self

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

impl Send for LlamaContextParams

Source§

impl Sync for LlamaContextParams

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, 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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.