pub struct LlamaLoraAdapter { /* private fields */ }Expand description
A safe wrapper around llama_lora_adapter.
The adapter is initialized from a GGUF file via
crate::model::LlamaModel::lora_adapter_init.
§Ownership
In ik_llama.cpp the adapter is owned by the model: it registers itself
with the model on init and is freed automatically when the model is freed
(llama.h: “will be freed when the model is deleted”). This type therefore
has no Drop — freeing it here would double-free (once here, once by the
model). Keep the crate::model::LlamaModel it came from alive for at least
as long as this adapter, and do not use an adapter after lora_adapter_clear
or after the owning model is dropped. (This mirrors the llama-cpp-2 anchor.)
Trait Implementations§
Auto Trait Implementations§
impl !Send for LlamaLoraAdapter
impl !Sync for LlamaLoraAdapter
impl Freeze for LlamaLoraAdapter
impl RefUnwindSafe for LlamaLoraAdapter
impl Unpin for LlamaLoraAdapter
impl UnsafeUnpin for LlamaLoraAdapter
impl UnwindSafe for LlamaLoraAdapter
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