diff --git a/ml-algorithms/src/main/java/org/opensearch/ml/engine/algorithms/metrics_correlation/MetricsCorrelation.java b/ml-algorithms/src/main/java/org/opensearch/ml/engine/algorithms/metrics_correlation/MetricsCorrelation.java index c37ea2b81d..8d3eca4c02 100644 --- a/ml-algorithms/src/main/java/org/opensearch/ml/engine/algorithms/metrics_correlation/MetricsCorrelation.java +++ b/ml-algorithms/src/main/java/org/opensearch/ml/engine/algorithms/metrics_correlation/MetricsCorrelation.java @@ -63,6 +63,7 @@ public class MetricsCorrelation extends DLModelExecute { private static final int AWAIT_BUSY_THRESHOLD = 1000; + public static final String MODEL_CONTENT_HASH = "4d7e4ede2293d3611def0f9fc4065852cb7f6841bc7df7d6bfc16562ae4f6743"; private Client client; private final Settings settings; //As metrics correlation is an experimental feature we are marking the version as 1.0.0b1 @@ -196,6 +197,7 @@ void registerModel(ActionListener listener) throws Inte .modelName(FunctionName.METRICS_CORRELATION.name()) .version(MCORR_ML_VERSION) .modelFormat(modelFormat) + .hashValue(MODEL_CONTENT_HASH) .modelConfig(modelConfig) .url(MCORR_MODEL_URL) .deployModel(true) diff --git a/ml-algorithms/src/test/java/org/opensearch/ml/engine/algorithms/metrics_correlation/MetricsCorrelationTest.java b/ml-algorithms/src/test/java/org/opensearch/ml/engine/algorithms/metrics_correlation/MetricsCorrelationTest.java index a227da0e1a..8af8379a84 100644 --- a/ml-algorithms/src/test/java/org/opensearch/ml/engine/algorithms/metrics_correlation/MetricsCorrelationTest.java +++ b/ml-algorithms/src/test/java/org/opensearch/ml/engine/algorithms/metrics_correlation/MetricsCorrelationTest.java @@ -76,6 +76,7 @@ import static org.mockito.Mockito.*; import static org.opensearch.ml.engine.algorithms.DLModel.*; import static org.opensearch.ml.engine.algorithms.metrics_correlation.MetricsCorrelation.MCORR_ML_VERSION; +import static org.opensearch.ml.engine.algorithms.metrics_correlation.MetricsCorrelation.MODEL_CONTENT_HASH; public class MetricsCorrelationTest { @@ -477,6 +478,7 @@ public void testRegisterModel() throws InterruptedException { assert mlRegisterModelInput.getModelFormat() == MLModelFormat.TORCH_SCRIPT; assert FunctionName.METRICS_CORRELATION.name().equals(mlRegisterModelInput.getModelName()); assert MCORR_ML_VERSION.equals(mlRegisterModelInput.getVersion()); + assert MODEL_CONTENT_HASH.equals(mlRegisterModelInput.getHashValue()); MLModelConfig modelConfig = mlRegisterModelInput.getModelConfig(); assert MetricsCorrelation.MODEL_TYPE.equals(modelConfig.getModelType()); assertNull(modelConfig.getAllConfig());