Skip to content

Commit b31158e

Browse files
committed
remove unnecessary field
1 parent 3b8fbf8 commit b31158e

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/chunking/EmbeddingRequestChunker.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ public record BatchRequestAndListener(BatchRequest batch, ActionListener<Inferen
6262
// are merged so that only this maximum number of chunks is stored.
6363
private static final int MAX_CHUNKS = 512;
6464

65-
private final List<String> inputs;
6665
private final List<BatchRequest> batchRequests;
6766
private final AtomicInteger resultCount = new AtomicInteger();
6867

@@ -81,7 +80,6 @@ public EmbeddingRequestChunker(List<String> inputs, int maxNumberOfInputsPerBatc
8180
}
8281

8382
public EmbeddingRequestChunker(List<String> inputs, int maxNumberOfInputsPerBatch, ChunkingSettings chunkingSettings) {
84-
this.inputs = inputs;
8583
this.resultEmbeddings = new ArrayList<>(inputs.size());
8684
this.resultOffsetStarts = new ArrayList<>(inputs.size());
8785
this.resultOffsetEnds = new ArrayList<>(inputs.size());
@@ -204,8 +202,8 @@ public void onFailure(Exception e) {
204202
}
205203

206204
private void sendFinalResponse() {
207-
var response = new ArrayList<ChunkedInference>(inputs.size());
208-
for (int i = 0; i < inputs.size(); i++) {
205+
var response = new ArrayList<ChunkedInference>(resultEmbeddings.size());
206+
for (int i = 0; i < resultEmbeddings.size(); i++) {
209207
if (resultsErrors.get(i) != null) {
210208
response.add(new ChunkedInferenceError(resultsErrors.get(i)));
211209
} else {
@@ -216,7 +214,6 @@ private void sendFinalResponse() {
216214
}
217215

218216
private ChunkedInference mergeResultsWithInputs(int inputIndex) {
219-
String input = inputs.get(inputIndex);
220217
List<Integer> startOffsets = resultOffsetStarts.get(inputIndex);
221218
List<Integer> endOffsets = resultOffsetEnds.get(inputIndex);
222219
AtomicReferenceArray<E> embeddings = resultEmbeddings.get(inputIndex);

0 commit comments

Comments
 (0)