Skip to content

Commit

Permalink
adding model content hash value (#885)
Browse files Browse the repository at this point in the history
* adding model content hash value

Signed-off-by: Dhrubo Saha <[email protected]>

* addressed comment

Signed-off-by: Dhrubo Saha <[email protected]>

---------

Signed-off-by: Dhrubo Saha <[email protected]>
  • Loading branch information
dhrubo-os authored May 5, 2023
1 parent 6ab48e2 commit 134e065
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -196,6 +197,7 @@ void registerModel(ActionListener<MLRegisterModelResponse> 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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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());
Expand Down

0 comments on commit 134e065

Please sign in to comment.