Skip to content

Commit d867f8b

Browse files
NeoXtreemEric Erhardt
authored and
Eric Erhardt
committed
Build extension method to reload changes without specifying model name (#4146)
1 parent 2ecc192 commit d867f8b

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/Microsoft.Extensions.ML/Builder/BuilderExtensions.cs

+19
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,25 @@ public static PredictionEnginePoolBuilder<TData, TPrediction> FromFile<TData, TP
158158
return builder.FromFile(string.Empty, filePath, true);
159159
}
160160

161+
/// <summary>
162+
/// Adds the model at the specified file to the builder.
163+
/// </summary>
164+
/// <param name="builder">The builder to which to add the model.</param>
165+
/// <param name="filePath">The location of the model.</param>
166+
/// <param name="watchForChanges">
167+
/// Whether to watch for changes to the file path and update the model when the file is changed or not.
168+
/// </param>
169+
/// <returns>
170+
/// The updated <see cref="PredictionEnginePoolBuilder{TData, TPrediction}"/>.
171+
/// </returns>
172+
public static PredictionEnginePoolBuilder<TData, TPrediction> FromFile<TData, TPrediction>(
173+
this PredictionEnginePoolBuilder<TData, TPrediction> builder, string filePath, bool watchForChanges)
174+
where TData : class
175+
where TPrediction : class, new()
176+
{
177+
return builder.FromFile(string.Empty, filePath, watchForChanges);
178+
}
179+
161180
/// <summary>
162181
/// Adds the model at the specified file to the builder.
163182
/// </summary>

0 commit comments

Comments
 (0)