Update app.py
Browse files
app.py
CHANGED
|
@@ -15,16 +15,16 @@ def respond(
|
|
| 15 |
history: list[tuple[str, str]],
|
| 16 |
image,
|
| 17 |
):
|
| 18 |
-
messages =
|
| 19 |
|
| 20 |
for val in history:
|
| 21 |
if val[0]:
|
| 22 |
-
messages
|
| 23 |
if val[1]:
|
| 24 |
-
messages
|
| 25 |
|
| 26 |
-
messages
|
| 27 |
-
print (
|
| 28 |
## for image
|
| 29 |
if isinstance(image, np.ndarray):
|
| 30 |
img = PIL.Image.fromarray(image)
|
|
|
|
| 15 |
history: list[tuple[str, str]],
|
| 16 |
image,
|
| 17 |
):
|
| 18 |
+
messages = ""
|
| 19 |
|
| 20 |
for val in history:
|
| 21 |
if val[0]:
|
| 22 |
+
messages += "{'role': 'user', 'content': "+val[0]+"}"
|
| 23 |
if val[1]:
|
| 24 |
+
messages += "{'role': 'user', 'content': "+val[1]+"}"
|
| 25 |
|
| 26 |
+
messages += "{'role': 'user', 'content': "+message+"}"
|
| 27 |
+
print (messages,image)
|
| 28 |
## for image
|
| 29 |
if isinstance(image, np.ndarray):
|
| 30 |
img = PIL.Image.fromarray(image)
|