Table of Contents

Method AddLoraAdapter

Namespace
LMKit.Finetuning
Assembly
LM-Kit.NET.dll

AddLoraAdapter(string, float)

Adds a LoRA (Low-Rank Adaptation) transformation to the internal list of adapters using the specified file path and scale factor.

public void AddLoraAdapter(string path, float scale = 1)

Parameters

path string

The file path to the LoRA parameters.

scale float

The scale factor for the LoRA parameters. Default value is 1.

Exceptions

ArgumentNullException

Thrown if the path parameter is null or empty.

ArgumentOutOfRangeException

Thrown if the scale parameter is less than or equal to 0.

FileNotFoundException

Thrown if the file specified by the path parameter does not exist.

InvalidDataException

Thrown if the file header is invalid.

RuntimeException

Thrown if the LoRA adaptation fails to load or apply correctly from the specified file. This may occur due to issues such as reading the file, parsing the adaptation parameters, or applying these parameters to the model.

AddLoraAdapter(LoraAdapterSource)

Adds a LoRA (Low-Rank Adaptation) transformation to the internal list of adapters using the specified file.

public void AddLoraAdapter(LoraAdapterSource loraAdapterSource)

Parameters

loraAdapterSource LoraAdapterSource

An instance of LoraAdapterSource that contains the path to the LoRA parameters and the scale factor.

Exceptions

ArgumentNullException

Thrown when loraAdapterSource is null.