summaryrefslogtreecommitdiff
path: root/RhSolutions.ML.Lib
diff options
context:
space:
mode:
Diffstat (limited to 'RhSolutions.ML.Lib')
-rw-r--r--RhSolutions.ML.Lib/RhSolutionsMLBuilder.cs7
1 files changed, 6 insertions, 1 deletions
diff --git a/RhSolutions.ML.Lib/RhSolutionsMLBuilder.cs b/RhSolutions.ML.Lib/RhSolutionsMLBuilder.cs
index be2e2a6..7030cf5 100644
--- a/RhSolutions.ML.Lib/RhSolutionsMLBuilder.cs
+++ b/RhSolutions.ML.Lib/RhSolutionsMLBuilder.cs
@@ -36,7 +36,12 @@ public class RhSolutionsMLBuilder
private static void SaveModelAsFile(MLContext mlContext, DataViewSchema trainingDataViewSchema, ITransformer model)
{
+ string path = Path.Combine(_appPath, "..", "..", "..", "..", "Models");
+ if (!Directory.Exists(path))
+ {
+ Directory.CreateDirectory(path);
+ }
mlContext.Model.Save(model, trainingDataViewSchema,
- Path.Combine(_appPath, "..", "..", "..", "..", "Models", "model.zip"));
+ Path.Combine(path, "model.zip"));
}
}