Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -39,11 +39,19 @@ def ask_openai_with_image(instruction, image):
|
|
| 39 |
{
|
| 40 |
"type": "image_url",
|
| 41 |
"role": "user",
|
| 42 |
-
"content":
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
}
|
| 48 |
],
|
| 49 |
"max_tokens": 4095,
|
|
|
|
| 39 |
{
|
| 40 |
"type": "image_url",
|
| 41 |
"role": "user",
|
| 42 |
+
"content": [
|
| 43 |
+
{
|
| 44 |
+
"type": "text",
|
| 45 |
+
"text": instruction if instruction else "",
|
| 46 |
+
},
|
| 47 |
+
{
|
| 48 |
+
"type": "image_url",
|
| 49 |
+
"image_url": {
|
| 50 |
+
"url": f"data:image/jpeg;base64,{base64_image}",
|
| 51 |
+
"detail": "high",
|
| 52 |
+
},
|
| 53 |
+
},
|
| 54 |
+
],
|
| 55 |
}
|
| 56 |
],
|
| 57 |
"max_tokens": 4095,
|