IOnnxModelDownloader

Interfaces · AiDotNet.Interfaces

Defines the contract for downloading ONNX models from remote sources.

Known implementations: OnnxModelDownloader

For Beginners

Instead of manually downloading model files, you can use implementers of this interface to automatically fetch models:

How It Works

This interface provides a way to download ONNX models from repositories like HuggingFace Hub or ONNX Model Zoo. It supports progress reporting and caching of downloaded models.

Methods

Method Summary
Task<IReadOnlyDictionary<string, string>> DownloadMultipleAsync(string modelId, IEnumerable<string> fileNames, IProgress<double> progress, CancellationToken cancellationToken) Downloads multiple ONNX files from a model repository.
Task<string> DownloadAsync(string modelId, string fileName, IProgress<double> progress, CancellationToken cancellationToken) Downloads an ONNX model from a remote repository.
long GetCacheSize() Gets the total size of the local cache in bytes.
string GetCachedPath(string modelId, string fileName) Checks if a model is already cached locally.
void ClearCache(string modelId) Clears the local cache for a specific model or all models.