diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2022-11-04 15:38:05 +0100 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2022-11-04 16:56:15 +0100 |
commit | 833f2df21c7d11a0f40dbbc31275d8f97156d541 (patch) | |
tree | 1765628e30b89699befb0b06a2f421a1ab1044d2 /model-integration/src/main | |
parent | 7eb6f8bcec2a2f13f368ebd115c9c8d2f559d95c (diff) |
Revert "Revert "Balder/model importing code in config model [run-systemtest]""
Diffstat (limited to 'model-integration/src/main')
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(); |