Update handler.py
Browse files- handler.py +5 -0
handler.py
CHANGED
|
@@ -13,8 +13,13 @@ class EndpointHandler():
|
|
| 13 |
|
| 14 |
|
| 15 |
def __call__(self, data: Dict[str, Any]) -> List[Dict[str, Any]]:
|
|
|
|
| 16 |
inputs = data.get("inputs")
|
|
|
|
|
|
|
| 17 |
text = inputs.get("text")
|
|
|
|
|
|
|
| 18 |
imageData = inputs.get("image")
|
| 19 |
image = Image.open(BytesIO(base64.b64decode(imageData)))
|
| 20 |
inputs = self.processor(text=text, images=image, return_tensors="pt", padding=True)
|
|
|
|
| 13 |
|
| 14 |
|
| 15 |
def __call__(self, data: Dict[str, Any]) -> List[Dict[str, Any]]:
|
| 16 |
+
print("** data: ", data)
|
| 17 |
inputs = data.get("inputs")
|
| 18 |
+
print("** inputs: ", inputs)
|
| 19 |
+
|
| 20 |
text = inputs.get("text")
|
| 21 |
+
print("** text: ", text)
|
| 22 |
+
|
| 23 |
imageData = inputs.get("image")
|
| 24 |
image = Image.open(BytesIO(base64.b64decode(imageData)))
|
| 25 |
inputs = self.processor(text=text, images=image, return_tensors="pt", padding=True)
|