summaryrefslogtreecommitdiffstats
path: root/model-integration/src/main/java/ai/vespa/rankingexpression
diff options
context:
space:
mode:
Diffstat (limited to 'model-integration/src/main/java/ai/vespa/rankingexpression')
-rw-r--r--model-integration/src/main/java/ai/vespa/rankingexpression/importer/ImportedModel.java19
-rw-r--r--model-integration/src/main/java/ai/vespa/rankingexpression/importer/configmodelview/ImportedMlModel.java6
2 files changed, 24 insertions, 1 deletions
diff --git a/model-integration/src/main/java/ai/vespa/rankingexpression/importer/ImportedModel.java b/model-integration/src/main/java/ai/vespa/rankingexpression/importer/ImportedModel.java
index 4e7710aa449..35c409a637c 100644
--- a/model-integration/src/main/java/ai/vespa/rankingexpression/importer/ImportedModel.java
+++ b/model-integration/src/main/java/ai/vespa/rankingexpression/importer/ImportedModel.java
@@ -81,10 +81,19 @@ public class ImportedModel implements ImportedMlModel {
}
/**
+ * Returns an immutable map of the small constants of this.
+ * These should have sizes up to a few kb at most, and correspond to constant values given in the source model.
+ */
+ @Override
+ public Map<String, Tensor> smallConstantTensors() { return Map.copyOf(smallConstants); }
+ /**
* Returns an immutable map of the small constants of this, represented as strings on the standard tensor form.
* These should have sizes up to a few kb at most, and correspond to constant values given in the source model.
+ * @deprecated Use smallConstantTensors instead
*/
@Override
+ @SuppressWarnings("removal")
+ @Deprecated(forRemoval = true)
public Map<String, String> smallConstants() { return asStrings(smallConstants); }
boolean hasSmallConstant(String name) { return smallConstants.containsKey(name); }
@@ -92,9 +101,17 @@ public class ImportedModel implements ImportedMlModel {
/**
* Returns an immutable map of the large constants of this.
* These can have sizes in gigabytes and must be distributed to nodes separately from configuration.
- * For TensorFlow this corresponds to Variable files stored separately.
*/
@Override
+ public Map<String, Tensor> largeConstantTensors() { return Map.copyOf(largeConstants); }
+ /**
+ * Returns an immutable map of the large constants of this, represented as strings on the standard tensor form.
+ * These can have sizes in gigabytes and must be distributed to nodes separately from configuration.
+ * @deprecated Use largeConstantTensors instead
+ */
+ @Override
+ @SuppressWarnings("removal")
+ @Deprecated(forRemoval = true)
public Map<String, String> largeConstants() { return asStrings(largeConstants); }
boolean hasLargeConstant(String name) { return largeConstants.containsKey(name); }
diff --git a/model-integration/src/main/java/ai/vespa/rankingexpression/importer/configmodelview/ImportedMlModel.java b/model-integration/src/main/java/ai/vespa/rankingexpression/importer/configmodelview/ImportedMlModel.java
index a2626818f87..8c8fc5c4b11 100644
--- a/model-integration/src/main/java/ai/vespa/rankingexpression/importer/configmodelview/ImportedMlModel.java
+++ b/model-integration/src/main/java/ai/vespa/rankingexpression/importer/configmodelview/ImportedMlModel.java
@@ -1,6 +1,8 @@
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package ai.vespa.rankingexpression.importer.configmodelview;
+import com.yahoo.tensor.Tensor;
+
import java.util.List;
import java.util.Map;
import java.util.Optional;
@@ -21,8 +23,12 @@ public interface ImportedMlModel {
ModelType modelType();
Optional<String> inputTypeSpec(String input);
+ @Deprecated(forRemoval = true)
Map<String, String> smallConstants();
+ @Deprecated(forRemoval = true)
Map<String, String> largeConstants();
+ Map<String, Tensor> smallConstantTensors();
+ Map<String, Tensor> largeConstantTensors();
Map<String, String> functions();
List<ImportedMlFunction> outputExpressions();