/// <summary> /// Update VW model from stream. /// </summary> /// <param name="modelStream">The model stream to load from.</param> public void Update(Stream modelStream) { if (modelStream == null) { return; } var model = new VowpalWabbitModel( new VowpalWabbitSettings { ModelStream = modelStream }); if (this.vwPool == null) { this.vwPool = this.CreatePool(new VowpalWabbitSettings { MaxExampleCacheSize = 1024, TypeInspector = this.typeInspector, EnableStringExampleGeneration = this.developmentMode, EnableStringFloatCompact = this.developmentMode }); this.vwPool.UpdateModel(model); } else { this.vwPool.UpdateModel(model); } }
/// <summary> /// Dispose the object. /// </summary> /// <param name="disposing">Whether the object is disposing resources.</param> protected virtual void Dispose(bool disposing) { if (disposing) { if (this.vwPool != null) { this.vwPool.Dispose(); this.vwPool = null; } } }