diff --git a/common/src/main/java/org/opensearch/ml/common/FunctionName.java b/common/src/main/java/org/opensearch/ml/common/FunctionName.java index 0a162689ad..72810459a4 100644 --- a/common/src/main/java/org/opensearch/ml/common/FunctionName.java +++ b/common/src/main/java/org/opensearch/ml/common/FunctionName.java @@ -34,17 +34,18 @@ public static FunctionName from(String value) { } } + private static final HashSet DL_MODELS = new HashSet<>(Set.of( + TEXT_EMBEDDING, + TEXT_SIMILARITY, + SPARSE_ENCODING, + SPARSE_TOKENIZE + )); + /** * Check if model is deep learning model. * @return true for deep learning model. */ public static boolean isDLModel(FunctionName functionName) { - Set dlmodels = new HashSet<>(Set.of( - TEXT_EMBEDDING, - TEXT_SIMILARITY, - SPARSE_ENCODING, - SPARSE_TOKENIZE - )); - return dlmodels.contains(functionName); + return DL_MODELS.contains(functionName); } }