From cb61003df114d55a05e9fc50346f009e02b3c434 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20de=20la=20R=C3=BAa=20Mart=C3=ADnez?= Date: Tue, 8 Feb 2022 09:58:28 +0100 Subject: [PATCH] [HOPSWORKS-2633][fix] Fix request payload encoding (#792) --- .../serving/inference/ServingInferenceUtils.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/hopsworks-common/src/main/java/io/hops/hopsworks/common/serving/inference/ServingInferenceUtils.java b/hopsworks-common/src/main/java/io/hops/hopsworks/common/serving/inference/ServingInferenceUtils.java index 2fef37feda..1ef7e17cdb 100755 --- a/hopsworks-common/src/main/java/io/hops/hopsworks/common/serving/inference/ServingInferenceUtils.java +++ b/hopsworks-common/src/main/java/io/hops/hopsworks/common/serving/inference/ServingInferenceUtils.java @@ -32,6 +32,17 @@ @TransactionAttribute(TransactionAttributeType.NEVER) public class ServingInferenceUtils { + /** + * Builds an inference request to be sent to a model deployment. All implementations of ServingInferenceController + * must use this method to build the inference request. + * + * @param host host of the deployment where the model server is running + * @param port port of the deployment where the model server is listening to + * @param path inference path + * @param json request payload + * @return the inference request + * @throws URISyntaxException + */ public HttpPost buildInferenceRequest(String host, int port, String path, String json) throws URISyntaxException { URI uri = new URIBuilder() .setScheme("http")