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
modelCardModelCardA ModelCard object.
storagePathstringAn optional parameter that specifies the location on the local machine where the model should be downloaded, if applicable.
deviceConfigurationLM.DeviceConfigurationAn optional LM.DeviceConfiguration object specifying device configuration options. Defaults to
null.loadingOptionsLM.LoadingOptionsAn optional LM.LoadingOptions object specifying various loading options. Defaults to
null.downloadingProgressLM.ModelDownloadingProgressCallbackAn optional reference to a ModelDownloadingProgressCallback to monitor the model's downloading progress.
loadingProgressLM.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
uriUriDefines 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.
storagePathstringAn optional parameter that specifies the location on the local machine where the model should be downloaded, if applicable.
deviceConfigurationLM.DeviceConfigurationAn optional LM.DeviceConfiguration object specifying device configuration options. Defaults to
null.loadingOptionsLM.LoadingOptionsAn optional LM.LoadingOptions object specifying various loading options. Defaults to
null.downloadingProgressLM.ModelDownloadingProgressCallbackAn optional reference to a ModelDownloadingProgressCallback to monitor the model's downloading progress.
loadingProgressLM.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
modelPathstringA path to a model file, in GGUF format.
deviceConfigurationLM.DeviceConfigurationAn optional LM.DeviceConfiguration object specifying device configuration options. Defaults to
null.loadingOptionsLM.LoadingOptionsAn optional LM.LoadingOptions object specifying various loading options. Defaults to
null.loadingProgressLM.ModelLoadingProgressCallbackAn optional ModelLoadingProgressCallback reference to monitor the progress of model loading.