Update handler.py
Browse files- handler.py +2 -0
handler.py
CHANGED
@@ -21,9 +21,11 @@ class EndpointHandler:
|
|
21 |
|
22 |
image_string_1 = base64.b64decode(data["image1"])
|
23 |
image_1 = Image.open(io.BytesIO(image_string_1))
|
|
|
24 |
|
25 |
image_string_2 = base64.b64decode(data["image2"])
|
26 |
image_2 = Image.open(io.BytesIO(image_string_2))
|
|
|
27 |
|
28 |
inputs = self.processor(images=[image_1, image_2], text=text, return_tensors="pt").to(self.device, torch.float16)
|
29 |
generated_ids = self.model.generate(**inputs)
|
|
|
21 |
|
22 |
image_string_1 = base64.b64decode(data["image1"])
|
23 |
image_1 = Image.open(io.BytesIO(image_string_1))
|
24 |
+
print(image_1.size)
|
25 |
|
26 |
image_string_2 = base64.b64decode(data["image2"])
|
27 |
image_2 = Image.open(io.BytesIO(image_string_2))
|
28 |
+
print(image_2.size)
|
29 |
|
30 |
inputs = self.processor(images=[image_1, image_2], text=text, return_tensors="pt").to(self.device, torch.float16)
|
31 |
generated_ids = self.model.generate(**inputs)
|