class
Llama::AdapterLora
- Llama::AdapterLora
- Reference
- Object
Overview
Wrapper for the llama_adapter_lora structure
This class represents a LoRA (Low-Rank Adaptation) adapter that can be applied to a model to modify its behavior without changing the original weights.
Defined in:
llama/adapter_lora.crllama/adapter_lora/error.cr
Constructors
-
.new(model : Model, path : String)
Creates a new LoRA adapter from a file
Instance Method Summary
-
#finalize
Frees the resources associated with this adapter
-
#to_unsafe : Pointer(Llama::LibLlama::LlamaAdapterLora)
Returns the raw pointer to the underlying llama_adapter_lora structure
Constructor Detail
Creates a new LoRA adapter from a file
Parameters:
- model: The Model to load the adapter for
- path: Path to the LoRA adapter file
Raises:
- Llama::AdapterLora::Error if the adapter cannot be loaded
Instance Method Detail
def to_unsafe : Pointer(Llama::LibLlama::LlamaAdapterLora)
#
Returns the raw pointer to the underlying llama_adapter_lora structure