Skip to content

Commit 0bcdd9c

Browse files
committed
review comments
1 parent 3809f63 commit 0bcdd9c

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/elasticsearch/ElasticsearchInternalService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1041,7 +1041,7 @@ private void inferBatchAndRunAfter(EmbeddingRequestChunker.BatchRequestAndListen
10411041
});
10421042

10431043
var maybeDeployListener = runNextListener.delegateResponse(
1044-
(l, exception) -> maybeStartDeployment(esModel, exception, inferenceRequest, runNextListener)
1044+
(l, exception) -> maybeStartDeployment(esModel, exception, inferenceRequest, l)
10451045
);
10461046

10471047
client.execute(InferModelAction.INSTANCE, inferenceRequest, maybeDeployListener);

x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/services/elasticsearch/ElasticsearchInternalServiceTests.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1283,10 +1283,7 @@ public void testChunkingLargeDocument() throws InterruptedException {
12831283

12841284
// build a doc with enough words to make numChunks of chunks
12851285
int numWords = numChunks * wordsPerChunk;
1286-
var docBuilder = new StringBuilder();
1287-
for (int i = 0; i < numWords; i++) {
1288-
docBuilder.append("word ");
1289-
}
1286+
var input = "word ".repeat(numWords);
12901287

12911288
// how many response objects to return in each batch
12921289
int[] numResponsesPerBatch = new int[numBatches];
@@ -1341,7 +1338,7 @@ public void testChunkingLargeDocument() throws InterruptedException {
13411338
service.chunkedInfer(
13421339
model,
13431340
null,
1344-
List.of(docBuilder.toString()),
1341+
List.of(input),
13451342
Map.of(),
13461343
InputType.SEARCH,
13471344
new ChunkingOptions(null, null),

0 commit comments

Comments
 (0)