Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -28,16 +28,23 @@ def ask_openai_with_image(instruction, image, low):
|
|
| 28 |
"messages": [
|
| 29 |
{
|
| 30 |
"role": "user",
|
| 31 |
-
"content":
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
}
|
| 42 |
],
|
| 43 |
"max_tokens": 4095,
|
|
|
|
| 28 |
"messages": [
|
| 29 |
{
|
| 30 |
"role": "user",
|
| 31 |
+
"content": [
|
| 32 |
+
{
|
| 33 |
+
"type": "text",
|
| 34 |
+
"text": start,
|
| 35 |
+
},
|
| 36 |
+
{
|
| 37 |
+
"type": "text",
|
| 38 |
+
"text": instruction,
|
| 39 |
+
},
|
| 40 |
+
{
|
| 41 |
+
"type": "image_url",
|
| 42 |
+
"image_url": {
|
| 43 |
+
"url": f"data:image/jpeg;base64,{base64_image}",
|
| 44 |
+
"detail": "low" if low_quality_mode else "high",
|
| 45 |
+
},
|
| 46 |
+
},
|
| 47 |
+
],
|
| 48 |
}
|
| 49 |
],
|
| 50 |
"max_tokens": 4095,
|