diff --git a/solr/modules/llm/src/java/org/apache/solr/llm/store/rest/ManagedEmbeddingModelStore.java b/solr/modules/llm/src/java/org/apache/solr/llm/store/rest/ManagedEmbeddingModelStore.java index f25a7a43f41..de3d89312a9 100644 --- a/solr/modules/llm/src/java/org/apache/solr/llm/store/rest/ManagedEmbeddingModelStore.java +++ b/solr/modules/llm/src/java/org/apache/solr/llm/store/rest/ManagedEmbeddingModelStore.java @@ -107,8 +107,7 @@ public void loadStoredModels() { private void addModelFromMap(Map modelMap) { try { - final SolrEmbeddingModel embedder = fromEmbeddingModelMap(modelMap); - addModel(embedder); + addModel(fromEmbeddingModelMap(modelMap)); } catch (final EmbeddingModelException e) { throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, e); } @@ -186,12 +185,10 @@ private static List modelsAsManagedResources(List mo @SuppressWarnings("unchecked") public static SolrEmbeddingModel fromEmbeddingModelMap(Map embeddingModel) { - final SolrEmbeddingModel embedder = - SolrEmbeddingModel.getInstance( + return SolrEmbeddingModel.getInstance( (String) embeddingModel.get(CLASS_KEY), // modelClassName (String) embeddingModel.get(NAME_KEY), // modelName (Map) embeddingModel.get(PARAMS_KEY)); - return embedder; } private static LinkedHashMap toEmbeddingModelMap(SolrEmbeddingModel model) {