Table of Contents

Constructor LM

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

LM(ModelCard, string, DeviceConfiguration, LoadingOptions, ModelDownloadingProgressCallback, ModelLoadingProgressCallback)

Creates an instance of the Model class from a ModelCard object.

public LM(ModelCard modelCard, string storagePath = "", LM.DeviceConfiguration deviceConfiguration = null, LM.LoadingOptions loadingOptions = null, LM.ModelDownloadingProgressCallback downloadingProgress = null, LM.ModelLoadingProgressCallback loadingProgress = null)

Parameters

modelCard ModelCard

A ModelCard object.

storagePath string

An optional parameter that specifies the location on the local machine where the model should be downloaded, if applicable.

deviceConfiguration LM.DeviceConfiguration

An optional LM.DeviceConfiguration object specifying device configuration options. Defaults to null.

loadingOptions LM.LoadingOptions

An optional LM.LoadingOptions object specifying various loading options. Defaults to null.

downloadingProgress LM.ModelDownloadingProgressCallback

An optional reference to a ModelDownloadingProgressCallback to monitor the model's downloading progress.

loadingProgress LM.ModelLoadingProgressCallback

An optional ModelLoadingProgressCallback reference to monitor the progress of model loading.

Exceptions

ArgumentNullException
ModelNotDownloadedException
ModelNotLoadedException

LM(Uri, string, DeviceConfiguration, LoadingOptions, ModelDownloadingProgressCallback, ModelLoadingProgressCallback)

Creates an instance of the Model class from a System.Uri object.

public LM(Uri uri, string storagePath = "", LM.DeviceConfiguration deviceConfiguration = null, LM.LoadingOptions loadingOptions = null, LM.ModelDownloadingProgressCallback downloadingProgress = null, LM.ModelLoadingProgressCallback loadingProgress = null)

Parameters

uri Uri

Defines the Uniform Resource Identifier (URI) indicating the location of the model. This can either be a web address using the HTTP protocol or a path to a local file.

storagePath string

An optional parameter that specifies the location on the local machine where the model should be downloaded, if applicable.

deviceConfiguration LM.DeviceConfiguration

An optional LM.DeviceConfiguration object specifying device configuration options. Defaults to null.

loadingOptions LM.LoadingOptions

An optional LM.LoadingOptions object specifying various loading options. Defaults to null.

downloadingProgress LM.ModelDownloadingProgressCallback

An optional reference to a ModelDownloadingProgressCallback to monitor the model's downloading progress.

loadingProgress LM.ModelLoadingProgressCallback

An optional ModelLoadingProgressCallback reference to monitor the progress of model loading.

Exceptions

ArgumentNullException
ModelNotDownloadedException
ModelNotLoadedException

LM(string, DeviceConfiguration, LoadingOptions, ModelLoadingProgressCallback)

Creates an instance of the Model class from a file.

public LM(string modelPath, LM.DeviceConfiguration deviceConfiguration = null, LM.LoadingOptions loadingOptions = null, LM.ModelLoadingProgressCallback loadingProgress = null)

Parameters

modelPath string

A path to a model file, in GGUF format.

deviceConfiguration LM.DeviceConfiguration

An optional LM.DeviceConfiguration object specifying device configuration options. Defaults to null.

loadingOptions LM.LoadingOptions

An optional LM.LoadingOptions object specifying various loading options. Defaults to null.

loadingProgress LM.ModelLoadingProgressCallback

An optional ModelLoadingProgressCallback reference to monitor the progress of model loading.

Exceptions

ArgumentNullException
FileNotFoundException
ModelNotLoadedException