Skip to content

Commit

Permalink
add deploySetting in registering pretrained models (opensearch-projec…
Browse files Browse the repository at this point in the history
…t#2415)

Signed-off-by: Xun Zhang <[email protected]>
  • Loading branch information
Zhangxunmt committed May 8, 2024
1 parent fba9606 commit 748fc7b
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

import org.opensearch.core.action.ActionListener;
import org.opensearch.ml.common.FunctionName;
import org.opensearch.ml.common.model.MLDeploySetting;
import org.opensearch.ml.common.model.MLModelConfig;
import org.opensearch.ml.common.model.MLModelFormat;
import org.opensearch.ml.common.model.QuestionAnsweringModelConfig;
Expand Down Expand Up @@ -70,6 +71,7 @@ public void downloadPrebuiltModelConfig(
boolean deployModel = registerModelInput.isDeployModel();
String[] modelNodeIds = registerModelInput.getModelNodeIds();
String modelGroupId = registerModelInput.getModelGroupId();
MLDeploySetting mlDeploySetting = registerModelInput.getDeploySetting();
try {
AccessController.doPrivileged((PrivilegedExceptionAction<Void>) () -> {

Expand Down Expand Up @@ -104,7 +106,9 @@ public void downloadPrebuiltModelConfig(
.modelNodeIds(modelNodeIds)
.isHidden(isHidden)
.modelGroupId(modelGroupId)
.functionName(FunctionName.from((functionName)));
.functionName(FunctionName.from((functionName)))
.deploySetting(mlDeploySetting);

config.entrySet().forEach(entry -> {
switch (entry.getKey().toString()) {
case MLRegisterModelInput.MODEL_FORMAT_FIELD:
Expand Down

0 comments on commit 748fc7b

Please sign in to comment.