Skip to content

Commit

Permalink
fix no worker node exception for remote embedding model
Browse files Browse the repository at this point in the history
Signed-off-by: Yaliang Wu <[email protected]>
  • Loading branch information
ylwu-amzn committed Oct 11, 2023
1 parent da5d829 commit 99e34a0
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,16 @@ private void executePredict(
String requestId = mlPredictionTaskRequest.getRequestID();
log.debug("receive predict request " + requestId + " for model " + mlPredictionTaskRequest.getModelId());
long startTime = System.nanoTime();
// For remote text embedding model, neural search will set mlPredictionTaskRequest.getMlInput().getAlgorithm() as
// TEXT_EMBEDDING. In ml-commons we should always use the real function name of model: REMOTE. So we try to get
// from model cache first.
FunctionName functionName = modelCacheHelper
.getOptionalFunctionName(modelId)
.orElse(mlPredictionTaskRequest.getMlInput().getAlgorithm());
mlPredictTaskRunner
.run(
mlPredictionTaskRequest.getMlInput().getAlgorithm(),
// This is by design to NOT use mlPredictionTaskRequest.getMlInput().getAlgorithm() here
functionName,
mlPredictionTaskRequest,
transportService,
ActionListener.runAfter(wrappedListener, () -> {
Expand Down

0 comments on commit 99e34a0

Please sign in to comment.