Skip to content

Commit

Permalink
Add validation to predictAction in connector
Browse files Browse the repository at this point in the history
Signed-off-by: zane-neo <[email protected]>
  • Loading branch information
zane-neo committed May 8, 2024
1 parent b6fa75f commit 284bb98
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ private Tuple<Integer, Integer> calculateChunkSize(TextDocsInputDataSet textDocs
}
} else {
Optional<ConnectorAction> predictAction = getConnector().findPredictAction();
if (predictAction.isEmpty()) {
throw new IllegalArgumentException("no predict action found");
}
String preProcessFunction = predictAction.get().getPreProcessFunction();
if (preProcessFunction != null && !MLPreProcessFunction.contains(preProcessFunction)) {
// user defined preprocess script, this case, the chunk size is always equals to text docs length.
Expand Down

0 comments on commit 284bb98

Please sign in to comment.