Skip to content

Commit

Permalink
fixed send.py
Browse files Browse the repository at this point in the history
  • Loading branch information
peytontolbert committed Mar 10, 2024
1 parent b0a93f8 commit ddddb63
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions scripts/send.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit ddddb63

Please sign in to comment.