From ddddb635c86c3ebb0a0fe01af137d6ad77fd2f90 Mon Sep 17 00:00:00 2001 From: peytontolbert Date: Sat, 9 Mar 2024 23:58:19 -0500 Subject: [PATCH] fixed send.py --- scripts/send.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/scripts/send.py b/scripts/send.py index a8133c7..4abc2d1 100644 --- a/scripts/send.py +++ b/scripts/send.py @@ -13,24 +13,24 @@ def image_to_base64(image_path): # Replace 'image.jpg' with the path to your image base64_image = image_to_base64('images/3897e80dcb0601c0.jpg') +text_data = { + "type": "text", + "text": "Describe what is in the image" +} +image_data = { + "type": "image_url", + "image_url": { + "url": f"data:image/jpeg;base64,{base64_image}" + } +} + # Construct the request data request_data = { "model": "cogvlm-chat-17b", "messages": [ { "role": "user", - "content": [ - { - "type": "text", - "text": "Whats in this image?" - }, - { - "type": "image_url", - "image_url": { - "url": f"data:image/jpeg;base64,{base64_image}" - } - } - ] + "content": [text_data, image_data] } ], "temperature": 0.8,