Update handler.py
Browse files- handler.py +4 -2
handler.py
CHANGED
|
@@ -43,14 +43,16 @@ class EndpointHandler:
|
|
| 43 |
|
| 44 |
# Decode base64 to image
|
| 45 |
image_data = base64.b64decode(base64_string)
|
| 46 |
-
|
|
|
|
|
|
|
| 47 |
messages = [
|
| 48 |
{
|
| 49 |
"role": "user",
|
| 50 |
"content": [
|
| 51 |
{
|
| 52 |
"type": "image",
|
| 53 |
-
"image":
|
| 54 |
},
|
| 55 |
{
|
| 56 |
"type": "text",
|
|
|
|
| 43 |
|
| 44 |
# Decode base64 to image
|
| 45 |
image_data = base64.b64decode(base64_string)
|
| 46 |
+
|
| 47 |
+
image = Image.open(io.BytesIO(image_data))
|
| 48 |
+
|
| 49 |
messages = [
|
| 50 |
{
|
| 51 |
"role": "user",
|
| 52 |
"content": [
|
| 53 |
{
|
| 54 |
"type": "image",
|
| 55 |
+
"image": image,
|
| 56 |
},
|
| 57 |
{
|
| 58 |
"type": "text",
|