Fix inputs
Browse files- handler.py +3 -2
handler.py
CHANGED
@@ -13,8 +13,9 @@ class EndpointHandler:
|
|
13 |
|
14 |
def __call__(self, data: Dict[str, Any]) -> Dict[str, str]:
|
15 |
# process input
|
16 |
-
|
17 |
-
|
|
|
18 |
|
19 |
# preprocess
|
20 |
encoding = self.processor(image, text, return_tensors="pt")
|
|
|
13 |
|
14 |
def __call__(self, data: Dict[str, Any]) -> Dict[str, str]:
|
15 |
# process input
|
16 |
+
inputs = data.pop("inputs", data)
|
17 |
+
image = inputs["image"]
|
18 |
+
text = inputs["text"]
|
19 |
|
20 |
# preprocess
|
21 |
encoding = self.processor(image, text, return_tensors="pt")
|