public BlobModelLoader(IOptions <MLOptions> contextOptions, IConfiguration configuration,
                        ILogger <BlobModelLoader> logger)
 {
     this.configuration = configuration;
     this.logger        = logger;
     reloadToken        = new ModelReloadToken();
     context            = contextOptions.Value?.MLContext;
 }
Exemplo n.º 2
0
        public AzureStorageMSModelLoader(
            IOptions <MLOptions> contextOptions,
            IStorageBlob <StorageBlobOptions> storageBlob,
            ILogger <AzureStorageMSModelLoader> logger)
        {
            _logger = logger ?? throw new ArgumentNullException(nameof(logger));

            if (contextOptions.Value?.MLContext == null)
            {
                throw new ArgumentNullException(nameof(contextOptions));
            }

            _mlContext   = contextOptions.Value.MLContext;
            _reloadToken = new ModelReloadToken();
            _stopping    = new CancellationTokenSource();
            _storageBlob = storageBlob ?? throw new ArgumentNullException(nameof(storageBlob));
        }