Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/Microsoft.Extensions.ML/Builder/BuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public static class BuilderExtensions
/// <returns>
/// The updated <see cref="PredictionEnginePoolBuilder{TData, TPrediction}"/>.
/// </returns>
/// <remarks>Only add models from trusted sources. Adding models from untrusted sources is a security risk.</remarks>
public static PredictionEnginePoolBuilder<TData, TPrediction> FromUri<TData, TPrediction>(
this PredictionEnginePoolBuilder<TData, TPrediction> builder, string uri)
where TData : class
Expand All @@ -41,6 +42,7 @@ public static PredictionEnginePoolBuilder<TData, TPrediction> FromUri<TData, TPr
/// <returns>
/// The updated <see cref="PredictionEnginePoolBuilder{TData, TPrediction}"/>.
/// </returns>
/// <remarks>Only add models from trusted sources. Adding models from untrusted sources is a security risk.</remarks>
public static PredictionEnginePoolBuilder<TData, TPrediction> FromUri<TData, TPrediction>(
this PredictionEnginePoolBuilder<TData, TPrediction> builder, string modelName, string uri)
where TData : class
Expand All @@ -62,6 +64,7 @@ public static PredictionEnginePoolBuilder<TData, TPrediction> FromUri<TData, TPr
/// <returns>
/// The updated <see cref="PredictionEnginePoolBuilder{TData, TPrediction}"/>.
/// </returns>
/// <remarks>Only add models from trusted sources. Adding models from untrusted sources is a security risk.</remarks>
public static PredictionEnginePoolBuilder<TData, TPrediction> FromUri<TData, TPrediction>(
this PredictionEnginePoolBuilder<TData, TPrediction> builder, string modelName, Uri uri)
where TData : class where TPrediction : class, new()
Expand All @@ -80,6 +83,7 @@ public static PredictionEnginePoolBuilder<TData, TPrediction> FromUri<TData, TPr
/// <returns>
/// The updated <see cref="PredictionEnginePoolBuilder{TData, TPrediction}"/>.
/// </returns>
/// <remarks>Only add models from trusted sources. Adding models from untrusted sources is a security risk.</remarks>
public static PredictionEnginePoolBuilder<TData, TPrediction> FromUri<TData, TPrediction>(
this PredictionEnginePoolBuilder<TData, TPrediction> builder, string uri, TimeSpan period)
where TData : class where TPrediction : class, new()
Expand All @@ -103,6 +107,7 @@ public static PredictionEnginePoolBuilder<TData, TPrediction> FromUri<TData, TPr
/// <returns>
/// The updated <see cref="PredictionEnginePoolBuilder{TData, TPrediction}"/>.
/// </returns>
/// <remarks>Only add models from trusted sources. Adding models from untrusted sources is a security risk.</remarks>
public static PredictionEnginePoolBuilder<TData, TPrediction> FromUri<TData, TPrediction>(
this PredictionEnginePoolBuilder<TData, TPrediction> builder, string modelName, string uri, TimeSpan period)
where TData : class
Expand All @@ -127,6 +132,7 @@ public static PredictionEnginePoolBuilder<TData, TPrediction> FromUri<TData, TPr
/// <returns>
/// The updated <see cref="PredictionEnginePoolBuilder{TData, TPrediction}"/>.
/// </returns>
/// <remarks>Only add models from trusted sources. Adding models from untrusted sources is a security risk.</remarks>
public static PredictionEnginePoolBuilder<TData, TPrediction> FromUri<TData, TPrediction>(
this PredictionEnginePoolBuilder<TData, TPrediction> builder, string modelName, Uri uri, TimeSpan period)
where TData : class
Expand All @@ -150,6 +156,7 @@ public static PredictionEnginePoolBuilder<TData, TPrediction> FromUri<TData, TPr
/// <returns>
/// The updated <see cref="PredictionEnginePoolBuilder{TData, TPrediction}"/>.
/// </returns>
/// <remarks>Only add models from trusted sources. Adding models from untrusted sources is a security risk.</remarks>
public static PredictionEnginePoolBuilder<TData, TPrediction> FromFile<TData, TPrediction>(
this PredictionEnginePoolBuilder<TData, TPrediction> builder, string filePath)
where TData : class
Expand All @@ -169,6 +176,7 @@ public static PredictionEnginePoolBuilder<TData, TPrediction> FromFile<TData, TP
/// <returns>
/// The updated <see cref="PredictionEnginePoolBuilder{TData, TPrediction}"/>.
/// </returns>
/// <remarks>Only add models from trusted sources. Adding models from untrusted sources is a security risk.</remarks>
public static PredictionEnginePoolBuilder<TData, TPrediction> FromFile<TData, TPrediction>(
this PredictionEnginePoolBuilder<TData, TPrediction> builder, string filePath, bool watchForChanges)
where TData : class
Expand All @@ -190,6 +198,7 @@ public static PredictionEnginePoolBuilder<TData, TPrediction> FromFile<TData, TP
/// <returns>
/// The updated <see cref="PredictionEnginePoolBuilder{TData, TPrediction}"/>.
/// </returns>
/// <remarks>Only add models from trusted sources. Adding models from untrusted sources is a security risk.</remarks>
public static PredictionEnginePoolBuilder<TData, TPrediction> FromFile<TData, TPrediction>(
this PredictionEnginePoolBuilder<TData, TPrediction> builder, string modelName, string filePath)
where TData : class
Expand All @@ -214,6 +223,7 @@ public static PredictionEnginePoolBuilder<TData, TPrediction> FromFile<TData, TP
/// <returns>
/// The updated <see cref="PredictionEnginePoolBuilder{TData, TPrediction}"/>.
/// </returns>
/// <remarks>Only add models from trusted sources. Adding models from untrusted sources is a security risk.</remarks>
public static PredictionEnginePoolBuilder<TData, TPrediction> FromFile<TData, TPrediction>(
this PredictionEnginePoolBuilder<TData, TPrediction> builder, string modelName, string filePath, bool watchForChanges)
where TData : class
Expand Down
4 changes: 4 additions & 0 deletions src/Microsoft.ML.Data/Model/ModelOperationsCatalog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ private void SaveInputSchema(DataViewSchema inputSchema, RepositoryWriter rep)
/// <param name="inputSchema">Will contain the input schema for the model. If the model was saved without
/// any description of the input, there will be no input schema. In this case this can be <see langword="null"/>.</param>
/// <returns>The loaded model.</returns>
/// <remarks>Only load models from trusted sources. Loading models from untrusted sources is a security risk.</remarks>
/// <example>
/// <format type="text/markdown">
/// <![CDATA[
Expand Down Expand Up @@ -201,6 +202,7 @@ public ITransformer Load(Stream stream, out DataViewSchema inputSchema)
/// <param name="inputSchema">Will contain the input schema for the model. If the model was saved without
/// any description of the input, there will be no input schema. In this case this can be <see langword="null"/>.</param>
/// <returns>The loaded model.</returns>
/// <remarks>Only load models from trusted sources. Loading models from untrusted sources is a security risk.</remarks>
/// <example>
/// <format type="text/markdown">
/// <![CDATA[
Expand Down Expand Up @@ -255,6 +257,7 @@ private ITransformer DecomposeLoader(ref IDataLoader<IMultiStreamSource> loader)
/// this method will throw an exception. The scenario where no loader is stored in the stream should
/// be handled instead using the <see cref="Load(Stream, out DataViewSchema)"/> method.</param>
/// <returns>The transformer model from the model stream.</returns>
/// <remarks>Only load models from trusted sources. Loading models from untrusted sources is a security risk.</remarks>
public ITransformer LoadWithDataLoader(Stream stream, out IDataLoader<IMultiStreamSource> loader)
{
_env.CheckValue(stream, nameof(stream));
Expand Down Expand Up @@ -283,6 +286,7 @@ public ITransformer LoadWithDataLoader(Stream stream, out IDataLoader<IMultiStre
/// this method will throw an exception. The scenario where no loader is stored in the stream should
/// be handled instead using the <see cref="Load(Stream, out DataViewSchema)"/> method.</param>
/// <returns>The transformer model from the model file.</returns>
/// <remarks>Only load models from trusted sources. Loading models from untrusted sources is a security risk.</remarks>
public ITransformer LoadWithDataLoader(string filePath, out IDataLoader<IMultiStreamSource> loader)
{
_env.CheckNonEmpty(filePath, nameof(filePath));
Expand Down
Loading
Loading