Rooni commited on
Commit
460611e
·
1 Parent(s): ca2b862

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -10
app.py CHANGED
@@ -28,16 +28,23 @@ def ask_openai_with_image(instruction, image, low):
28
  "messages": [
29
  {
30
  "role": "user",
31
- "content": start,
32
- },
33
- {
34
- "role": "user",
35
- "content": instruction,
36
- },
37
- {
38
- "role": "system",
39
- "content": f"data:image/jpeg;base64,{base64_image}",
40
- "detail": "low" if low else "high",
 
 
 
 
 
 
 
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,