diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2022-11-09 20:16:11 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-09 20:16:11 +0100 |
commit | ba3ac72d3146d9e64a4bf32c993fd4969b272c7d (patch) | |
tree | b9e57f781bde4d962835b4ffdc56a58e5d7585cd /config-model/src/main/java/com/yahoo/vespa/model/ml/ConvertedModel.java | |
parent | 606bc6b517e09bba9f36a4ef6506a588d1254bd4 (diff) | |
parent | ec1413c6baca2e30bdd732ca8e20a108c9e66852 (diff) |
Merge pull request #24814 from vespa-engine/revert-24813-revert-24773-revert-24760-balder/model-importing-code-in-config-model-3v8.82.24
Revert "Revert "Revert "Balder/model importing code in config model [run-systemtest]"""
Diffstat (limited to 'config-model/src/main/java/com/yahoo/vespa/model/ml/ConvertedModel.java')
-rw-r--r-- | config-model/src/main/java/com/yahoo/vespa/model/ml/ConvertedModel.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/ml/ConvertedModel.java b/config-model/src/main/java/com/yahoo/vespa/model/ml/ConvertedModel.java index 96a6b39dc1a..9ba87fd24bf 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/ml/ConvertedModel.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/ml/ConvertedModel.java @@ -199,8 +199,8 @@ public class ConvertedModel { ModelStore store) { // Add constants Set<String> constantsReplacedByFunctions = new HashSet<>(); - model.smallConstantTensors().forEach((k, v) -> transformSmallConstant(store, profile, k, v)); - model.largeConstantTensors().forEach((k, v) -> transformLargeConstant(store, profile, queryProfiles, + model.smallConstants().forEach((k, v) -> transformSmallConstant(store, profile, k, v)); + model.largeConstants().forEach((k, v) -> transformLargeConstant(store, profile, queryProfiles, constantsReplacedByFunctions, k, v)); // Add functions @@ -294,7 +294,8 @@ public class ConvertedModel { } private static void transformSmallConstant(ModelStore store, RankProfile profile, String constantName, - Tensor constantValue) { + String constantValueString) { + Tensor constantValue = Tensor.from(constantValueString); store.writeSmallConstant(constantName, constantValue); Reference name = FeatureNames.asConstantFeature(constantName); profile.add(new RankProfile.Constant(name, constantValue)); @@ -305,7 +306,8 @@ public class ConvertedModel { QueryProfileRegistry queryProfiles, Set<String> constantsReplacedByFunctions, String constantName, - Tensor constantValue) { + String constantValueString) { + Tensor constantValue = Tensor.from(constantValueString); RankProfile.RankingExpressionFunction rankingExpressionFunctionOverridingConstant = profile.getFunctions().get(constantName); if (rankingExpressionFunctionOverridingConstant != null) { TensorType functionType = rankingExpressionFunctionOverridingConstant.function().getBody().type(profile.typeContext(queryProfiles)); |