Update app.py
Browse files
app.py
CHANGED
|
@@ -750,20 +750,21 @@ def chat():
|
|
| 750 |
"role": "user",
|
| 751 |
"content": [
|
| 752 |
{
|
| 753 |
-
"type": "
|
| 754 |
"text": prompt if prompt else "Describe this image."
|
| 755 |
},
|
| 756 |
{
|
| 757 |
# Cohere accepts data URI as image url - keep the data URI if present
|
| 758 |
-
"type": "
|
| 759 |
-
"
|
|
|
|
|
|
|
|
|
|
| 760 |
}
|
| 761 |
]
|
| 762 |
}
|
| 763 |
],
|
| 764 |
-
|
| 765 |
-
"temperature": 0.6,
|
| 766 |
-
"max_tokens": 800
|
| 767 |
}
|
| 768 |
|
| 769 |
headers = {
|
|
|
|
| 750 |
"role": "user",
|
| 751 |
"content": [
|
| 752 |
{
|
| 753 |
+
"type": "text",
|
| 754 |
"text": prompt if prompt else "Describe this image."
|
| 755 |
},
|
| 756 |
{
|
| 757 |
# Cohere accepts data URI as image url - keep the data URI if present
|
| 758 |
+
"type": "image_url",
|
| 759 |
+
"image_url": {
|
| 760 |
+
"url": image_base64,
|
| 761 |
+
"detail": "auto"
|
| 762 |
+
}
|
| 763 |
}
|
| 764 |
]
|
| 765 |
}
|
| 766 |
],
|
| 767 |
+
|
|
|
|
|
|
|
| 768 |
}
|
| 769 |
|
| 770 |
headers = {
|