Skip to content
Merged
Changes from 1 commit
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
11 changes: 11 additions & 0 deletions src/Microsoft.ML.Data/Utilities/ModelFileUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ internal static class ModelFileUtils
{
public const string DirPredictor = "Predictor";
public const string DirDataLoaderModel = "DataLoaderModel";
public const string DirTransformerChain = "TransformerChain";
Comment thread
najeeb-kazmi marked this conversation as resolved.
Outdated
public const string SchemaEntryName = "Schema";
// ResultsProcessor needs access to this constant.
public const string DirTrainingInfo = "TrainingInfo";

Expand Down Expand Up @@ -64,6 +66,15 @@ public static IDataView LoadPipeline(IHostEnvironment env, RepositoryReader rep,
Contracts.CheckValue(env, nameof(env));
env.CheckValue(rep, nameof(rep));
env.CheckValue(files, nameof(files));

var entry = rep.OpenEntryOrNull(SchemaEntryName);
if (entry != null)
{
var loader = new BinaryLoader(env, new BinaryLoader.Arguments(), entry.Stream);
ModelLoadContext.LoadModel<ITransformer, SignatureLoadModel>(env, out var transformerChain, rep, DirTransformerChain);
return transformerChain.Transform(loader);
}

using (var ent = rep.OpenEntry(DirDataLoaderModel, ModelLoadContext.ModelStreamName))
{
ILegacyDataLoader loader;
Expand Down