Skip to content

Commit

Permalink
optimize import
Browse files Browse the repository at this point in the history
Signed-off-by: xinyual <[email protected]>
  • Loading branch information
xinyual committed Nov 12, 2023
1 parent cb35dd8 commit a439b63
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions plugin/src/main/java/org/opensearch/ml/model/MLModelManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
import static org.opensearch.ml.common.CommonValue.NOT_FOUND;
import static org.opensearch.ml.common.CommonValue.UNDEPLOYED;
import static org.opensearch.ml.common.MLModel.ALGORITHM_FIELD;
import static org.opensearch.ml.common.MLTask.*;
import static org.opensearch.ml.common.MLTask.FUNCTION_NAME_FIELD;
import static org.opensearch.ml.common.MLTask.ERROR_FIELD;
import static org.opensearch.ml.common.MLTask.MODEL_ID_FIELD;
import static org.opensearch.ml.common.MLTask.STATE_FIELD;
import static org.opensearch.ml.common.MLTaskState.COMPLETED;
import static org.opensearch.ml.common.MLTaskState.FAILED;
import static org.opensearch.ml.engine.ModelHelper.CHUNK_FILES;
Expand Down Expand Up @@ -755,7 +758,13 @@ private void registerPrebuiltModel(MLRegisterModelInput registerModelInput, MLTa
}
modelHelper.downloadPrebuiltModelConfig(taskId, registerModelInput, ActionListener.wrap(mlRegisterModelInput -> {
mlTask.setFunctionName(mlRegisterModelInput.getFunctionName());
mlTaskManager.updateMLTask(taskId, ImmutableMap.of(FUNCTION_NAME_FIELD, mlRegisterModelInput.getFunctionName()), TIMEOUT_IN_MILLIS, false);
mlTaskManager
.updateMLTask(
taskId,
ImmutableMap.of(FUNCTION_NAME_FIELD, mlRegisterModelInput.getFunctionName()),
TIMEOUT_IN_MILLIS,
false
);
registerModelFromUrl(mlRegisterModelInput, mlTask, modelVersion);
}, e -> {
log.error("Failed to register prebuilt model", e);
Expand Down

0 comments on commit a439b63

Please sign in to comment.