smileycutie0 commited on
Commit
adffcb2
·
verified ·
1 Parent(s): a7aae14

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -7
app.py CHANGED
@@ -19,13 +19,16 @@ def caption(image):
19
  out = ""
20
  for chunk in client.chat.completions.create(
21
  model="openai-large",
22
- messages=[{
23
- "role": "user",
24
- "content": [
25
- {"type": "text", "text": PROMPT},
26
- {"type": "image_url", "image_url": {"url": image_to_base64(image)}}
27
- ]
28
- }],
 
 
 
29
  stream=True
30
  ):
31
  out += chunk.choices[0].delta.content
 
19
  out = ""
20
  for chunk in client.chat.completions.create(
21
  model="openai-large",
22
+ messages=[
23
+ {
24
+ "role": "user",
25
+ "content": [
26
+ {"type": "text", "text": PROMPT},
27
+ {"type": "image_url", "image_url": {"url": image_to_base64(image)}}
28
+ ]
29
+ }
30
+ ],
31
+ max_tokens=1024,
32
  stream=True
33
  ):
34
  out += chunk.choices[0].delta.content