From 12704eaaec2b4815bcfcb557366ea2d31722cd0d Mon Sep 17 00:00:00 2001 From: Alessandro Benedetti Date: Mon, 18 Nov 2024 11:46:44 +0000 Subject: [PATCH] minor clean up --- .../solr/llm/store/rest/ManagedEmbeddingModelStore.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) 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) {