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
pathstringThe file path to the LoRA parameters.
scalefloatThe scale factor for the LoRA parameters. Default value is 1.
Exceptions
- ArgumentNullException
Thrown if the
pathparameter is null or empty.- ArgumentOutOfRangeException
Thrown if the
scaleparameter is less than or equal to 0.- FileNotFoundException
Thrown if the file specified by the
pathparameter 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
loraAdapterSourceLoraAdapterSourceAn instance of LoraAdapterSource that contains the path to the LoRA parameters and the scale factor.
Exceptions
- ArgumentNullException
Thrown when
loraAdapterSourceis null.