summaryrefslogtreecommitdiffstats
path: root/config-model
diff options
context:
space:
mode:
authorHÃ¥kon Hallingstad <hakon@oath.com>2018-01-22 23:57:02 +0100
committerGitHub <noreply@github.com>2018-01-22 23:57:02 +0100
commitbf7db444e31324b46a330a1046443a3ad227ab1f (patch)
treee74404b6e1a1587b158ef4e76c5889f2148daae4 /config-model
parent9ffa1b65e571c1878b3b5b26fc8f00d95efb9d3c (diff)
Revert "Correct path just once"
Diffstat (limited to 'config-model')
-rw-r--r--config-model/src/main/java/com/yahoo/searchdefinition/expressiontransforms/TensorFlowFeatureConverter.java11
1 files changed, 7 insertions, 4 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 c16d12f76d1..629aef7f56c 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,7 +4,6 @@ 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;
@@ -255,9 +254,13 @@ 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(FilesApplicationPackage.preprocessed)
- && ! constantPath.elements().contains(FilesApplicationPackage.preprocessed)) {
- constantPathCorrected = Path.fromString(FilesApplicationPackage.preprocessed).append(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);
}
// Remember the constant in a file we replicate in ZooKeeper