Rooni commited on
Commit
4f5052d
·
verified ·
1 Parent(s): c26fd8f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -5
app.py CHANGED
@@ -39,11 +39,19 @@ def ask_openai_with_image(instruction, image):
39
  {
40
  "type": "image_url",
41
  "role": "user",
42
- "content": f"data:image/jpeg;base64,{base64_image}"
43
- },
44
- {
45
- "role": "user",
46
- "content": instruction if instruction else "",
 
 
 
 
 
 
 
 
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,