class Llama::AdapterLora

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.cr
llama/adapter_lora/error.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(model : Model, path : String) #

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

[View source]

Instance Method Detail

def finalize #

Frees the resources associated with this adapter


[View source]
def to_unsafe : Pointer(Llama::LibLlama::LlamaAdapterLora) #

Returns the raw pointer to the underlying llama_adapter_lora structure


[View source]