diff options
author | Jon Bratseth <bratseth@verizonmedia.com> | 2019-06-28 15:31:32 -0500 |
---|---|---|
committer | Jon Bratseth <bratseth@verizonmedia.com> | 2019-06-28 15:31:32 -0500 |
commit | 42386c87f27961e2c94672e3203b6f43f5f29e04 (patch) | |
tree | e669ff20e9681800ebad10c81a97df3562f070d7 /application/src/main | |
parent | 35680fa4af2061d57c886624b422749219b77b52 (diff) |
Support model-evaluation in Application
Diffstat (limited to 'application/src/main')
-rw-r--r-- | application/src/main/java/com/yahoo/application/Application.java | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/application/src/main/java/com/yahoo/application/Application.java b/application/src/main/java/com/yahoo/application/Application.java index fb812ba6107..dffe458c798 100644 --- a/application/src/main/java/com/yahoo/application/Application.java +++ b/application/src/main/java/com/yahoo/application/Application.java @@ -1,6 +1,11 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.application; +import ai.vespa.rankingexpression.importer.configmodelview.MlModelImporter; +import ai.vespa.rankingexpression.importer.onnx.OnnxImporter; +import ai.vespa.rankingexpression.importer.tensorflow.TensorFlowImporter; +import ai.vespa.rankingexpression.importer.vespa.VespaImporter; +import ai.vespa.rankingexpression.importer.xgboost.XGBoostImporter; import com.google.common.annotations.Beta; import com.yahoo.application.container.JDisc; import com.yahoo.application.container.impl.StandaloneContainerRunner; @@ -109,9 +114,13 @@ public final class Application implements AutoCloseable { private VespaModel createVespaModel() { try { + List<MlModelImporter> modelImporters = List.of(new VespaImporter(), + new TensorFlowImporter(), + new OnnxImporter(), + new XGBoostImporter()); DeployState deployState = new DeployState.Builder() - .applicationPackage(FilesApplicationPackage.fromFile(path.toFile(), - /* Include source files */ true)) + .applicationPackage(FilesApplicationPackage.fromFile(path.toFile(), true)) + .modelImporters(modelImporters) .deployLogger((level, s) -> { }) .build(); return new VespaModel(new NullConfigModelRegistry(), deployState); @@ -133,6 +142,7 @@ public final class Application implements AutoCloseable { @Override public void close() { container.close(); + IOUtils.recursiveDeleteDir(new File(path.toFile(), "models.generated")); if (deletePathWhenClosing) IOUtils.recursiveDeleteDir(path.toFile()); } |