diff options
author | Jon Bratseth <bratseth@oath.com> | 2018-08-30 23:13:03 +0200 |
---|---|---|
committer | Jon Bratseth <bratseth@oath.com> | 2018-08-30 23:13:03 +0200 |
commit | 41a8c4ef3222c7c1e7f376b9a2c417d390379710 (patch) | |
tree | a26a5aaca83a1da5924e62d1636c2bea52fff12b /config-model | |
parent | 8a1c7bb53923ba9fa01c3c6ceba2046be0530d11 (diff) |
Scope converted models to their rank profile
Diffstat (limited to 'config-model')
4 files changed, 5 insertions, 5 deletions
diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/expressiontransforms/ConvertedModel.java b/config-model/src/main/java/com/yahoo/searchdefinition/expressiontransforms/ConvertedModel.java index f7a06f86ab7..6acb9ff1f7e 100644 --- a/config-model/src/main/java/com/yahoo/searchdefinition/expressiontransforms/ConvertedModel.java +++ b/config-model/src/main/java/com/yahoo/searchdefinition/expressiontransforms/ConvertedModel.java @@ -86,14 +86,15 @@ public class ConvertedModel { */ public static ConvertedModel fromSourceOrStore(Path modelPath, RankProfileTransformContext context) { File sourceModel = sourceModelFile(context.rankProfile().applicationPackage(), modelPath); + String modelName = context.rankProfile().getName() + "." + toModelName(modelPath); // must be unique to each profile if (sourceModel.exists()) - return fromSource(toModelName(modelPath), + return fromSource(modelName, modelPath.toString(), context.rankProfile(), context.queryProfiles(), context.importedModels().get(sourceModel)); // TODO: Convert to name here, make sure its done just one way else - return fromStore(toModelName(modelPath), + return fromStore(modelName, modelPath.toString(), context.rankProfile()); } diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/derived/GeminiTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/derived/GeminiTestCase.java index c7725a98eb5..4bc61f20d95 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/derived/GeminiTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/derived/GeminiTestCase.java @@ -62,7 +62,6 @@ public class GeminiTestCase extends AbstractExportingTestCase { private String lookup(String expressionName, Map<String, String> ranking) { String value = ranking.get("rankingExpression(" + expressionName + ").rankingScript"); if (value == null) { - System.out.println("Warning: No expression found for " + expressionName); return expressionName; } return value; diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/processing/RankingExpressionWithOnnxTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/processing/RankingExpressionWithOnnxTestCase.java index 04a6f953bb6..414a77e9164 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/processing/RankingExpressionWithOnnxTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/processing/RankingExpressionWithOnnxTestCase.java @@ -258,7 +258,7 @@ public class RankingExpressionWithOnnxTestCase { */ private void assertLargeConstant(String name, RankProfileSearchFixture search, Optional<Long> expectedSize) { try { - Path constantApplicationPackagePath = Path.fromString("models.generated/mnist_softmax.onnx/constants").append(name + ".tbf"); + Path constantApplicationPackagePath = Path.fromString("models.generated/my_profile.mnist_softmax.onnx/constants").append(name + ".tbf"); RankingConstant rankingConstant = search.search().rankingConstants().get(name); assertEquals(name, rankingConstant.getName()); assertTrue(rankingConstant.getFileName().endsWith(constantApplicationPackagePath.toString())); diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/processing/RankingExpressionWithTensorFlowTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/processing/RankingExpressionWithTensorFlowTestCase.java index 28fcf871cf3..450c66e04ef 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/processing/RankingExpressionWithTensorFlowTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/processing/RankingExpressionWithTensorFlowTestCase.java @@ -403,7 +403,7 @@ public class RankingExpressionWithTensorFlowTestCase { */ private void assertLargeConstant(String name, RankProfileSearchFixture search, Optional<Long> expectedSize) { try { - Path constantApplicationPackagePath = Path.fromString("models.generated/mnist_softmax_saved/constants").append(name + ".tbf"); + Path constantApplicationPackagePath = Path.fromString("models.generated/my_profile.mnist_softmax_saved/constants").append(name + ".tbf"); RankingConstant rankingConstant = search.search().rankingConstants().get(name); assertEquals(name, rankingConstant.getName()); assertTrue(rankingConstant.getFileName().endsWith(constantApplicationPackagePath.toString())); |