diff options
author | Jon Bratseth <jonbratseth@yahoo.com> | 2018-01-23 07:57:40 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-23 07:57:40 +0100 |
commit | 8d552622ab4187609867aae49bd345a73ec2d24c (patch) | |
tree | 5db7aa48138a13f640672e0c34d8501fae186417 /config-model/src | |
parent | 1956fa077d9b218bee4df013d002cf1c20490f85 (diff) |
Revert "Revert "Correct path just once""
Diffstat (limited to 'config-model/src')
-rw-r--r-- | config-model/src/main/java/com/yahoo/searchdefinition/expressiontransforms/TensorFlowFeatureConverter.java | 11 |
1 files changed, 4 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 629aef7f56c..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; @@ -254,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 |