pub struct LlamaModelParams {
pub params: llama_model_params,
/* private fields */
}Fields§
§params: llama_model_paramsImplementations§
Source§impl LlamaModelParams
impl LlamaModelParams
pub const fn kv_overrides(&self) -> KvOverrides<'_>
Sourcepub fn append_kv_override(
self: Pin<&mut Self>,
key: &CStr,
value: ParamOverrideValue,
) -> Result<(), ModelParamsError>
pub fn append_kv_override( self: Pin<&mut Self>, key: &CStr, value: ParamOverrideValue, ) -> Result<(), ModelParamsError>
§Errors
Returns ModelParamsError if the internal override vector has no available slot,
the slot is not empty, or the key contains invalid characters.
Source§impl LlamaModelParams
impl LlamaModelParams
Sourcepub fn add_cpu_moe_override(
self: Pin<&mut Self>,
) -> Result<(), ModelParamsError>
pub fn add_cpu_moe_override( self: Pin<&mut Self>, ) -> Result<(), ModelParamsError>
§Errors
Returns ModelParamsError if the internal override vector has no available slot,
the slot is not empty, or the key contains invalid characters.
Sourcepub fn add_cpu_buft_override(
self: Pin<&mut Self>,
key: &CStr,
) -> Result<(), ModelParamsError>
pub fn add_cpu_buft_override( self: Pin<&mut Self>, key: &CStr, ) -> Result<(), ModelParamsError>
§Errors
Returns ModelParamsError if the internal override vector has no available slot,
the slot is not empty, or the key contains invalid characters.
Source§impl LlamaModelParams
impl LlamaModelParams
pub const fn n_gpu_layers(&self) -> i32
pub const fn main_gpu(&self) -> i32
pub const fn vocab_only(&self) -> bool
pub const fn use_mmap(&self) -> bool
pub const fn use_mlock(&self) -> bool
Sourcepub fn split_mode(&self) -> Result<LlamaSplitMode, LlamaSplitModeParseError>
pub fn split_mode(&self) -> Result<LlamaSplitMode, LlamaSplitModeParseError>
§Errors
Returns LlamaSplitModeParseError if the unknown split mode is encountered.
pub fn devices(&self) -> Vec<usize>
pub fn with_n_gpu_layers(self, n_gpu_layers: u32) -> Self
pub const fn with_main_gpu(self, main_gpu: i32) -> Self
pub const fn with_vocab_only(self, vocab_only: bool) -> Self
pub const fn with_use_mmap(self, use_mmap: bool) -> Self
pub const fn no_alloc(&self) -> bool
pub const fn with_no_alloc(self, no_alloc: bool) -> Self
pub const fn with_use_mlock(self, use_mlock: bool) -> Self
pub fn with_split_mode(self, split_mode: LlamaSplitMode) -> Self
Sourcepub fn with_devices(self, devices: &[usize]) -> Result<Self, LlamaCppError>
pub fn with_devices(self, devices: &[usize]) -> Result<Self, LlamaCppError>
§Errors
Returns LlamaCppError::BackendDeviceNotFound if any device index is invalid.
Source§impl LlamaModelParams
impl LlamaModelParams
Sourcepub fn fit_params(
self: Pin<&mut Self>,
model_path: &CStr,
context_params: &mut LlamaContextParams,
margins: &mut [usize],
n_ctx_min: u32,
log_level: ggml_log_level,
) -> Result<FitResult, FitError>
pub fn fit_params( self: Pin<&mut Self>, model_path: &CStr, context_params: &mut LlamaContextParams, margins: &mut [usize], n_ctx_min: u32, log_level: ggml_log_level, ) -> Result<FitResult, FitError>
Trait Implementations§
Source§impl Debug for LlamaModelParams
impl Debug for LlamaModelParams
Auto Trait Implementations§
impl Freeze for LlamaModelParams
impl RefUnwindSafe for LlamaModelParams
impl !Send for LlamaModelParams
impl !Sync for LlamaModelParams
impl Unpin for LlamaModelParams
impl UnsafeUnpin for LlamaModelParams
impl UnwindSafe for LlamaModelParams
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> 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