From 82ef649740433f2a6c4dce647e6d2130bbb19979 Mon Sep 17 00:00:00 2001 From: Siddharth Venkatesan Date: Fri, 25 Oct 2024 08:12:52 -0700 Subject: [PATCH] =?UTF-8?q?[fix]=20Propagate=20RollingBatch=20predict=20ou?= =?UTF-8?q?tput=20code=20to=20request=20outputs=20(=E2=80=A6=20(#2495)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: David Thomas --- .../src/main/java/ai/djl/python/engine/RollingBatch.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/engines/python/src/main/java/ai/djl/python/engine/RollingBatch.java b/engines/python/src/main/java/ai/djl/python/engine/RollingBatch.java index 6ee285c64..5eb191119 100644 --- a/engines/python/src/main/java/ai/djl/python/engine/RollingBatch.java +++ b/engines/python/src/main/java/ai/djl/python/engine/RollingBatch.java @@ -174,6 +174,11 @@ public void run() { BytesSupplier err = BytesSupplier.wrap(JsonUtils.GSON.toJson(out)); for (Request req : list) { req.last = true; + + // Note: This will only change the HTTP response code if the first chunk + // has not yet been sent + req.output.setCode(code); + req.data.appendContent(err, true); } list.clear();