pop image
Browse files- handler.py +3 -3
- test.py +0 -0
handler.py
CHANGED
@@ -20,9 +20,9 @@ class EndpointHandler():
|
|
20 |
Return:
|
21 |
A :obj:`list` | `dict`: will be serialized and returned
|
22 |
"""
|
23 |
-
|
24 |
-
words =
|
25 |
-
imageData =
|
26 |
image = Image.open(BytesIO(base64.b64decode(imageData)))
|
27 |
inputs = self.processor(text=words, images=image, return_tensors="pt", padding=True)
|
28 |
outputs = self.model(**inputs)
|
|
|
20 |
Return:
|
21 |
A :obj:`list` | `dict`: will be serialized and returned
|
22 |
"""
|
23 |
+
inputs = data.pop("inputs", data)
|
24 |
+
words = inputs["words"]
|
25 |
+
imageData = inputs["image"]
|
26 |
image = Image.open(BytesIO(base64.b64decode(imageData)))
|
27 |
inputs = self.processor(text=words, images=image, return_tensors="pt", padding=True)
|
28 |
outputs = self.model(**inputs)
|
test.py
ADDED
File without changes
|