Update handler.py
Browse files- handler.py +2 -2
handler.py
CHANGED
|
@@ -24,9 +24,9 @@ class EndpointHandler:
|
|
| 24 |
|
| 25 |
def __call__(self, data: Dict[str, Any]) -> str:
|
| 26 |
# Prepare your messages with image and text
|
| 27 |
-
|
| 28 |
|
| 29 |
-
img_bytes = base64.b64decode(
|
| 30 |
pil_img = Image.open(io.BytesIO(img_bytes)).convert("RGB")
|
| 31 |
|
| 32 |
messages = [
|
|
|
|
| 24 |
|
| 25 |
def __call__(self, data: Dict[str, Any]) -> str:
|
| 26 |
# Prepare your messages with image and text
|
| 27 |
+
base64image = data.get("base64")
|
| 28 |
|
| 29 |
+
img_bytes = base64.b64decode(base64image)
|
| 30 |
pil_img = Image.open(io.BytesIO(img_bytes)).convert("RGB")
|
| 31 |
|
| 32 |
messages = [
|