Constructor LLM
LLM(Uri, string, DeviceConfiguration, LoadingOptions, ModelDownloadingProgressCallback, ModelLoadingProgressCallback)
Creates an instance of the Model class from a System.Uri object.
public LLM(Uri uri, string storagePath = "", LLM.DeviceConfiguration deviceConfiguration = null, LLM.LoadingOptions loadingOptions = null, LLM.ModelDownloadingProgressCallback downloadingProgress = null, LLM.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
LLM.DeviceConfigurationAn optional LLM.DeviceConfiguration object specifying device configuration options. Defaults to
null
.loadingOptions
LLM.LoadingOptionsAn optional LLM.LoadingOptions object specifying various loading options. Defaults to
null
.downloadingProgress
LLM.ModelDownloadingProgressCallbackAn optional reference to a ModelDownloadingProgressCallback to monitor the model's downloading progress.
loadingProgress
LLM.ModelLoadingProgressCallbackAn optional ModelLoadingProgressCallback reference to monitor the progress of model loading.
Exceptions
LLM(string, DeviceConfiguration, LoadingOptions, ModelLoadingProgressCallback)
Creates an instance of the Model class from a file.
public LLM(string modelPath, LLM.DeviceConfiguration deviceConfiguration = null, LLM.LoadingOptions loadingOptions = null, LLM.ModelLoadingProgressCallback loadingProgress = null)
Parameters
modelPath
stringA path to a model file, in GGUF format.
deviceConfiguration
LLM.DeviceConfigurationAn optional LLM.DeviceConfiguration object specifying device configuration options. Defaults to
null
.loadingOptions
LLM.LoadingOptionsAn optional LLM.LoadingOptions object specifying various loading options. Defaults to
null
.loadingProgress
LLM.ModelLoadingProgressCallbackAn optional ModelLoadingProgressCallback reference to monitor the progress of model loading.