Skip to content

Commit

Permalink
minor clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
alessandrobenedetti committed Nov 18, 2024
1 parent 4589687 commit 12704ea
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,7 @@ public void loadStoredModels() {

private void addModelFromMap(Map<String, Object> modelMap) {
try {
final SolrEmbeddingModel embedder = fromEmbeddingModelMap(modelMap);
addModel(embedder);
addModel(fromEmbeddingModelMap(modelMap));
} catch (final EmbeddingModelException e) {
throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, e);
}
Expand Down Expand Up @@ -186,12 +185,10 @@ private static List<Object> modelsAsManagedResources(List<SolrEmbeddingModel> mo

@SuppressWarnings("unchecked")
public static SolrEmbeddingModel fromEmbeddingModelMap(Map<String, Object> embeddingModel) {
final SolrEmbeddingModel embedder =
SolrEmbeddingModel.getInstance(
return SolrEmbeddingModel.getInstance(
(String) embeddingModel.get(CLASS_KEY), // modelClassName
(String) embeddingModel.get(NAME_KEY), // modelName
(Map<String, Object>) embeddingModel.get(PARAMS_KEY));
return embedder;
}

private static LinkedHashMap<String, Object> toEmbeddingModelMap(SolrEmbeddingModel model) {
Expand Down

0 comments on commit 12704ea

Please sign in to comment.