diff options
Diffstat (limited to 'config-model/src/main/java/com/yahoo/searchdefinition/expressiontransforms/TensorFlowFeatureConverter.java')
-rw-r--r-- | config-model/src/main/java/com/yahoo/searchdefinition/expressiontransforms/TensorFlowFeatureConverter.java | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/expressiontransforms/TensorFlowFeatureConverter.java b/config-model/src/main/java/com/yahoo/searchdefinition/expressiontransforms/TensorFlowFeatureConverter.java index d6b758daaf4..c16d12f76d1 100644 --- a/config-model/src/main/java/com/yahoo/searchdefinition/expressiontransforms/TensorFlowFeatureConverter.java +++ b/config-model/src/main/java/com/yahoo/searchdefinition/expressiontransforms/TensorFlowFeatureConverter.java @@ -4,6 +4,7 @@ package com.yahoo.searchdefinition.expressiontransforms; import com.google.common.base.Joiner; import com.yahoo.config.application.api.ApplicationFile; import com.yahoo.config.application.api.ApplicationPackage; +import com.yahoo.config.model.application.provider.FilesApplicationPackage; import com.yahoo.io.IOUtils; import com.yahoo.path.Path; import com.yahoo.searchdefinition.RankProfile; @@ -89,6 +90,7 @@ public class TensorFlowFeatureConverter extends ExpressionTransformer<RankProfil store.writeConverted(expression); model.constants().forEach((k, v) -> transformConstant(store, profile, k, v)); + return expression.getRoot(); } @@ -253,13 +255,9 @@ public class TensorFlowFeatureConverter extends ExpressionTransformer<RankProfil // "tbf" ending for "typed binary format" - recognized by the nodes receiving the file: Path constantPath = constantsPath.append(name + ".tbf"); Path constantPathCorrected = constantPath; - if (application.getFileReference(Path.fromString("")).getAbsolutePath().endsWith(".preprocessed")) { - log.info("Correcting TensorFlow constant path by prepending .preprocessed - alternative 1"); - constantPathCorrected = Path.fromString(".preprocessed").append(constantPath); - } - else if (application.getFileReference(Path.fromString("")).getAbsolutePath().endsWith(".preprocessed")) { - log.info("Correcting TensorFlow constant path by prepending .preprocessed - alternative 2"); - constantPathCorrected = Path.fromString(".preprocessed").append(constantPath); + if (application.getFileReference(Path.fromString("")).getAbsolutePath().endsWith(FilesApplicationPackage.preprocessed) + && ! constantPath.elements().contains(FilesApplicationPackage.preprocessed)) { + constantPathCorrected = Path.fromString(FilesApplicationPackage.preprocessed).append(constantPath); } // Remember the constant in a file we replicate in ZooKeeper |