pub struct LlamaContextParams {
pub context_params: llama_context_params,
}Fields§
§context_params: llama_context_paramsImplementations§
Source§impl LlamaContextParams
impl LlamaContextParams
pub fn with_n_ctx(self, n_ctx: Option<NonZeroU32>) -> Self
pub const fn n_ctx(&self) -> Option<NonZeroU32>
pub const fn with_n_batch(self, n_batch: u32) -> Self
pub const fn n_batch(&self) -> u32
pub const fn with_n_ubatch(self, n_ubatch: u32) -> Self
pub const fn n_ubatch(&self) -> u32
pub const fn with_flash_attention_policy( self, policy: llama_flash_attn_type, ) -> Self
pub const fn flash_attention_policy(&self) -> llama_flash_attn_type
pub const fn with_offload_kqv(self, enabled: bool) -> Self
pub const fn offload_kqv(&self) -> bool
pub fn with_rope_scaling_type(self, rope_scaling_type: RopeScalingType) -> Self
pub fn rope_scaling_type(&self) -> RopeScalingType
pub const fn with_rope_freq_base(self, rope_freq_base: f32) -> Self
pub const fn rope_freq_base(&self) -> f32
pub const fn with_rope_freq_scale(self, rope_freq_scale: f32) -> Self
pub const fn rope_freq_scale(&self) -> f32
pub const fn n_threads(&self) -> i32
pub const fn n_threads_batch(&self) -> i32
pub const fn with_n_threads(self, n_threads: i32) -> Self
pub const fn with_n_threads_batch(self, n_threads: i32) -> Self
pub const fn embeddings(&self) -> bool
pub const fn with_embeddings(self, embedding: bool) -> Self
pub fn with_cb_eval(self, cb_eval: ggml_backend_sched_eval_callback) -> Self
pub const fn with_cb_eval_user_data( self, cb_eval_user_data: *mut c_void, ) -> Self
pub fn with_pooling_type(self, pooling_type: LlamaPoolingType) -> Self
pub fn pooling_type(&self) -> LlamaPoolingType
pub const fn with_swa_full(self, enabled: bool) -> Self
pub const fn swa_full(&self) -> bool
pub const fn with_n_seq_max(self, n_seq_max: u32) -> Self
pub const fn n_seq_max(&self) -> u32
pub fn with_type_k(self, type_k: KvCacheType) -> Self
pub fn type_k(&self) -> KvCacheType
pub fn with_type_v(self, type_v: KvCacheType) -> Self
pub fn type_v(&self) -> KvCacheType
pub fn with_attention_type(self, attention_type: LlamaAttentionType) -> Self
pub fn attention_type(&self) -> LlamaAttentionType
pub const fn with_yarn_ext_factor(self, yarn_ext_factor: f32) -> Self
pub const fn yarn_ext_factor(&self) -> f32
pub const fn with_yarn_attn_factor(self, yarn_attn_factor: f32) -> Self
pub const fn yarn_attn_factor(&self) -> f32
pub const fn with_yarn_beta_fast(self, yarn_beta_fast: f32) -> Self
pub const fn yarn_beta_fast(&self) -> f32
pub const fn with_yarn_beta_slow(self, yarn_beta_slow: f32) -> Self
pub const fn yarn_beta_slow(&self) -> f32
pub const fn with_yarn_orig_ctx(self, yarn_orig_ctx: u32) -> Self
pub const fn yarn_orig_ctx(&self) -> u32
pub const fn with_defrag_thold(self, defrag_thold: f32) -> Self
pub const fn defrag_thold(&self) -> f32
pub const fn with_no_perf(self, no_perf: bool) -> Self
pub const fn no_perf(&self) -> bool
pub const fn with_op_offload(self, op_offload: bool) -> Self
pub const fn op_offload(&self) -> bool
pub const fn with_kv_unified(self, kv_unified: bool) -> Self
pub const fn kv_unified(&self) -> bool
Trait Implementations§
Source§impl Clone for LlamaContextParams
impl Clone for LlamaContextParams
Source§fn clone(&self) -> LlamaContextParams
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)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LlamaContextParams
impl Debug for LlamaContextParams
Source§impl Default for LlamaContextParams
impl Default for LlamaContextParams
impl Send for LlamaContextParams
impl Sync for LlamaContextParams
Auto Trait Implementations§
impl Freeze for LlamaContextParams
impl RefUnwindSafe for LlamaContextParams
impl Unpin for LlamaContextParams
impl UnsafeUnpin for LlamaContextParams
impl UnwindSafe for LlamaContextParams
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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