Spaces:
Running
Running
smileycutie0
commited on
Update app.py
Browse files
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 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 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
|