Table of Contents

Method Merge

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

Merge(string, MetadataCollection)

Merges the currently loaded LoRA (Low-Rank Adaptation) transformations into the base model and saves the result to the specified destination file path.
This operation combines the base model with the applied LoRA adapters, allowing for efficient fine-tuning of the model.

public void Merge(string modelPath, LLM.MetadataCollection metadataOverrides = null)

Parameters

modelPath string

The file path where the merged model will be saved. This path must be valid and not empty.

metadataOverrides LLM.MetadataCollection

A collection of metadata overrides to apply during the merging process. Defaults to null.

Exceptions

ArgumentNullException

Thrown if modelPath is null or contains only whitespace.

InvalidOperationException

Thrown if no LoRA adapters have been added. At least one adapter is required for merging.

LoraMergingException

Thrown if the merging operation fails due to an internal error during the merging process.