Skip to content

Commit

Permalink
fix toList for jvm version
Browse files Browse the repository at this point in the history
Signed-off-by: zhichao-aws <[email protected]>
  • Loading branch information
zhichao-aws committed Dec 18, 2024
1 parent dde124f commit 4b1e665
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import java.util.Map;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.stream.Collectors;

import lombok.Getter;
import org.opensearch.cluster.service.ClusterService;
Expand Down Expand Up @@ -63,7 +64,7 @@ public void doExecute(
List<Map<String, Float>> sparseVectors = TokenWeightUtil.fetchListOfTokenWeightMap(resultMaps)
.stream()
.map(vector -> PruneUtils.pruneSparseVector(pruneType, pruneRatio, vector))
.toList();
.collect(Collectors.toList());
setVectorFieldsToDocument(ingestDocument, ProcessMap, sparseVectors);
handler.accept(ingestDocument, null);
}, e -> { handler.accept(null, e); }));
Expand All @@ -75,7 +76,7 @@ public void doBatchExecute(List<String> inferenceList, Consumer<List<?>> handler
List<Map<String, Float>> sparseVectors = TokenWeightUtil.fetchListOfTokenWeightMap(resultMaps)
.stream()
.map(vector -> PruneUtils.pruneSparseVector(pruneType, pruneRatio, vector))
.toList();
.collect(Collectors.toList());
handler.accept(sparseVectors);
}, onException));
}
Expand Down

0 comments on commit 4b1e665

Please sign in to comment.