We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
KFServing Transformer does not work with onnxruntime and trtis model server
/kind bug

**What steps did you take and what happened:**
Currently kfserving transformer does not work with onnxruntime and trtis model server due to following validation because their data plane do not support `instances` key in JSON.
https://github.com/kubeflow/kfserving/blob/master/python/kfserving/kfserving/handlers/http.py#L24 



**What did you expect to happen:**
Before we get to V2 data plane with agreed protocol across model servers, we should relax this validation.

**Anything else you would like to add:**
[Miscellaneous information that will assist in solving the issue.]


**Environment:**

- Istio Version:
- Knative Version:
- KFServing Version: 0.2.2
- Kubeflow version:
- Minikube version:
- Kubernetes version: (use `kubectl version`):
- OS (e.g. from `/etc/os-release`):


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `python/kfserving/kfserving/handlers/http.py`
Content:
```
1 import tornado.web
2 import json
3 from typing import Dict
4 from http import HTTPStatus
5 from kfserving.kfmodel import KFModel
6 
7 
8 class HTTPHandler(tornado.web.RequestHandler):
9     def initialize(self, models: Dict[str, KFModel]):
10         self.models = models # pylint:disable=attribute-defined-outside-init
11 
12     def get_model(self, name: str):
13         if name not in self.models:
14             raise tornado.web.HTTPError(
15                 status_code=HTTPStatus.NOT_FOUND,
16                 reason="Model with name %s does not exist." % name
17             )
18         model = self.models[name]
19         if not model.ready:
20             model.load()
21         return model
22 
23     def validate(self, request):
24         if "instances" not in request:
25             raise tornado.web.HTTPError(
26                 status_code=HTTPStatus.BAD_REQUEST,
27                 reason="Expected key \"instances\" in request body"
28             )
29 
30         if not isinstance(request["instances"], list):
31             raise tornado.web.HTTPError(
32                 status_code=HTTPStatus.BAD_REQUEST,
33                 reason="Expected \"instances\" to be a list"
34             )
35         return request
36 
37 
38 class PredictHandler(HTTPHandler):
39     def post(self, name: str):
40         model = self.get_model(name)
41         try:
42             body = json.loads(self.request.body)
43         except json.decoder.JSONDecodeError as e:
44             raise tornado.web.HTTPError(
45                 status_code=HTTPStatus.BAD_REQUEST,
46                 reason="Unrecognized request format: %s" % e
47             )
48         request = model.preprocess(body)
49         request = self.validate(request)
50         response = model.predict(request)
51         response = model.postprocess(response)
52         self.write(response)
53 
54 
55 class ExplainHandler(HTTPHandler):
56     def post(self, name: str):
57         model = self.get_model(name)
58         try:
59             body = json.loads(self.request.body)
60         except json.decoder.JSONDecodeError as e:
61             raise tornado.web.HTTPError(
62                 status_code=HTTPStatus.BAD_REQUEST,
63                 reason="Unrecognized request format: %s" % e
64             )
65         request = model.preprocess(body)
66         request = self.validate(request)
67         response = model.explain(request)
68         response = model.postprocess(response)
69         self.write(response)
70
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/python/kfserving/kfserving/handlers/http.py b/python/kfserving/kfserving/handlers/http.py
--- a/python/kfserving/kfserving/handlers/http.py
+++ b/python/kfserving/kfserving/handlers/http.py
@@ -21,13 +21,7 @@
         return model
 
     def validate(self, request):
-        if "instances" not in request:
-            raise tornado.web.HTTPError(
-                status_code=HTTPStatus.BAD_REQUEST,
-                reason="Expected key \"instances\" in request body"
-            )
-
-        if not isinstance(request["instances"], list):
+        if "instances" in request and not isinstance(request["instances"], list):
             raise tornado.web.HTTPError(
                 status_code=HTTPStatus.BAD_REQUEST,
                 reason="Expected \"instances\" to be a list"

{"golden_diff": "diff --git a/python/kfserving/kfserving/handlers/http.py b/python/kfserving/kfserving/handlers/http.py\n--- a/python/kfserving/kfserving/handlers/http.py\n+++ b/python/kfserving/kfserving/handlers/http.py\n@@ -21,13 +21,7 @@\n         return model\n \n     def validate(self, request):\n-        if \"instances\" not in request:\n-            raise tornado.web.HTTPError(\n-                status_code=HTTPStatus.BAD_REQUEST,\n-                reason=\"Expected key \\\"instances\\\" in request body\"\n-            )\n-\n-        if not isinstance(request[\"instances\"], list):\n+        if \"instances\" in request and not isinstance(request[\"instances\"], list):\n             raise tornado.web.HTTPError(\n                 status_code=HTTPStatus.BAD_REQUEST,\n                 reason=\"Expected \\\"instances\\\" to be a list\"\n", "issue": "KFServing Transformer does not work with onnxruntime and trtis model server\n/kind bug\r\n\r\n**What steps did you take and what happened:**\r\nCurrently kfserving transformer does not work with onnxruntime and trtis model server due to following validation because their data plane do not support `instances` key in JSON.\r\nhttps://github.com/kubeflow/kfserving/blob/master/python/kfserving/kfserving/handlers/http.py#L24 \r\n\r\n\r\n\r\n**What did you expect to happen:**\r\nBefore we get to V2 data plane with agreed protocol across model servers, we should relax this validation.\r\n\r\n**Anything else you would like to add:**\r\n[Miscellaneous information that will assist in solving the issue.]\r\n\r\n\r\n**Environment:**\r\n\r\n- Istio Version:\r\n- Knative Version:\r\n- KFServing Version: 0.2.2\r\n- Kubeflow version:\r\n- Minikube version:\r\n- Kubernetes version: (use `kubectl version`):\r\n- OS (e.g. from `/etc/os-release`):\r\n\n", "before_files": [{"content": "import tornado.web\nimport json\nfrom typing import Dict\nfrom http import HTTPStatus\nfrom kfserving.kfmodel import KFModel\n\n\nclass HTTPHandler(tornado.web.RequestHandler):\n    def initialize(self, models: Dict[str, KFModel]):\n        self.models = models # pylint:disable=attribute-defined-outside-init\n\n    def get_model(self, name: str):\n        if name not in self.models:\n            raise tornado.web.HTTPError(\n                status_code=HTTPStatus.NOT_FOUND,\n                reason=\"Model with name %s does not exist.\" % name\n            )\n        model = self.models[name]\n        if not model.ready:\n            model.load()\n        return model\n\n    def validate(self, request):\n        if \"instances\" not in request:\n            raise tornado.web.HTTPError(\n                status_code=HTTPStatus.BAD_REQUEST,\n                reason=\"Expected key \\\"instances\\\" in request body\"\n            )\n\n        if not isinstance(request[\"instances\"], list):\n            raise tornado.web.HTTPError(\n                status_code=HTTPStatus.BAD_REQUEST,\n                reason=\"Expected \\\"instances\\\" to be a list\"\n            )\n        return request\n\n\nclass PredictHandler(HTTPHandler):\n    def post(self, name: str):\n        model = self.get_model(name)\n        try:\n            body = json.loads(self.request.body)\n        except json.decoder.JSONDecodeError as e:\n            raise tornado.web.HTTPError(\n                status_code=HTTPStatus.BAD_REQUEST,\n                reason=\"Unrecognized request format: %s\" % e\n            )\n        request = model.preprocess(body)\n        request = self.validate(request)\n        response = model.predict(request)\n        response = model.postprocess(response)\n        self.write(response)\n\n\nclass ExplainHandler(HTTPHandler):\n    def post(self, name: str):\n        model = self.get_model(name)\n        try:\n            body = json.loads(self.request.body)\n        except json.decoder.JSONDecodeError as e:\n            raise tornado.web.HTTPError(\n                status_code=HTTPStatus.BAD_REQUEST,\n                reason=\"Unrecognized request format: %s\" % e\n            )\n        request = model.preprocess(body)\n        request = self.validate(request)\n        response = model.explain(request)\n        response = model.postprocess(response)\n        self.write(response)\n", "path": "python/kfserving/kfserving/handlers/http.py"}], "after_files": [{"content": "import tornado.web\nimport json\nfrom typing import Dict\nfrom http import HTTPStatus\nfrom kfserving.kfmodel import KFModel\n\n\nclass HTTPHandler(tornado.web.RequestHandler):\n    def initialize(self, models: Dict[str, KFModel]):\n        self.models = models # pylint:disable=attribute-defined-outside-init\n\n    def get_model(self, name: str):\n        if name not in self.models:\n            raise tornado.web.HTTPError(\n                status_code=HTTPStatus.NOT_FOUND,\n                reason=\"Model with name %s does not exist.\" % name\n            )\n        model = self.models[name]\n        if not model.ready:\n            model.load()\n        return model\n\n    def validate(self, request):\n        if \"instances\" in request and not isinstance(request[\"instances\"], list):\n            raise tornado.web.HTTPError(\n                status_code=HTTPStatus.BAD_REQUEST,\n                reason=\"Expected \\\"instances\\\" to be a list\"\n            )\n        return request\n\n\nclass PredictHandler(HTTPHandler):\n    def post(self, name: str):\n        model = self.get_model(name)\n        try:\n            body = json.loads(self.request.body)\n        except json.decoder.JSONDecodeError as e:\n            raise tornado.web.HTTPError(\n                status_code=HTTPStatus.BAD_REQUEST,\n                reason=\"Unrecognized request format: %s\" % e\n            )\n        request = model.preprocess(body)\n        request = self.validate(request)\n        response = model.predict(request)\n        response = model.postprocess(response)\n        self.write(response)\n\n\nclass ExplainHandler(HTTPHandler):\n    def post(self, name: str):\n        model = self.get_model(name)\n        try:\n            body = json.loads(self.request.body)\n        except json.decoder.JSONDecodeError as e:\n            raise tornado.web.HTTPError(\n                status_code=HTTPStatus.BAD_REQUEST,\n                reason=\"Unrecognized request format: %s\" % e\n            )\n        request = model.preprocess(body)\n        request = self.validate(request)\n        response = model.explain(request)\n        response = model.postprocess(response)\n        self.write(response)\n", "path": "python/kfserving/kfserving/handlers/http.py"}]}