Constructor LM
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
ModelCardA ModelCard object.
storagePath
stringAn optional parameter that specifies the location on the local machine where the model should be downloaded, if applicable.
deviceConfiguration
LM.DeviceConfigurationAn optional LM.DeviceConfiguration object specifying device configuration options. Defaults to
null
.loadingOptions
LM.LoadingOptionsAn optional LM.LoadingOptions object specifying various loading options. Defaults to
null
.downloadingProgress
LM.ModelDownloadingProgressCallbackAn optional reference to a ModelDownloadingProgressCallback to monitor the model's downloading progress.
loadingProgress
LM.ModelLoadingProgressCallbackAn optional ModelLoadingProgressCallback reference to monitor the progress of model loading.
Exceptions
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
UriDefines 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
stringAn optional parameter that specifies the location on the local machine where the model should be downloaded, if applicable.
deviceConfiguration
LM.DeviceConfigurationAn optional LM.DeviceConfiguration object specifying device configuration options. Defaults to
null
.loadingOptions
LM.LoadingOptionsAn optional LM.LoadingOptions object specifying various loading options. Defaults to
null
.downloadingProgress
LM.ModelDownloadingProgressCallbackAn optional reference to a ModelDownloadingProgressCallback to monitor the model's downloading progress.
loadingProgress
LM.ModelLoadingProgressCallbackAn optional ModelLoadingProgressCallback reference to monitor the progress of model loading.
Exceptions
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
stringA path to a model file, in GGUF format.
deviceConfiguration
LM.DeviceConfigurationAn optional LM.DeviceConfiguration object specifying device configuration options. Defaults to
null
.loadingOptions
LM.LoadingOptionsAn optional LM.LoadingOptions object specifying various loading options. Defaults to
null
.loadingProgress
LM.ModelLoadingProgressCallbackAn optional ModelLoadingProgressCallback reference to monitor the progress of model loading.