From 7ca765acefdfa1590445fd21482b4d608c3a45a6 Mon Sep 17 00:00:00 2001 From: Jason Payne Date: Mon, 26 Aug 2019 02:01:31 +0200 Subject: [PATCH] Build extension method to reload changes without specifying model name --- .../Builder/BuilderExtensions.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/Microsoft.Extensions.ML/Builder/BuilderExtensions.cs b/src/Microsoft.Extensions.ML/Builder/BuilderExtensions.cs index ebeb366086..45ededdb10 100644 --- a/src/Microsoft.Extensions.ML/Builder/BuilderExtensions.cs +++ b/src/Microsoft.Extensions.ML/Builder/BuilderExtensions.cs @@ -158,6 +158,25 @@ public static PredictionEnginePoolBuilder FromFile + /// Adds the model at the specified file to the builder. + /// + /// The builder to which to add the model. + /// The location of the model. + /// + /// Whether to watch for changes to the file path and update the model when the file is changed or not. + /// + /// + /// The updated . + /// + public static PredictionEnginePoolBuilder FromFile( + this PredictionEnginePoolBuilder builder, string filePath, bool watchForChanges) + where TData : class + where TPrediction : class, new() + { + return builder.FromFile(string.Empty, filePath, watchForChanges); + } + /// /// Adds the model at the specified file to the builder. ///