Commit
·
e8a6491
1
Parent(s):
d50939e
update
Browse files
app.py
CHANGED
|
@@ -93,6 +93,9 @@ def bot(history):
|
|
| 93 |
gr.Warning("The number of images uploaded is less than the number of <image> placeholders in the text. Will automatically remove extra <image> placeholders from the text.")
|
| 94 |
cur_messages['text'] = cur_messages['text'][::-1].replace("<image>"[::-1], "", cur_messages['text'].count("<image>") - len(cur_messages['images']))[::-1]
|
| 95 |
history[-1][0] = cur_messages["text"]
|
|
|
|
|
|
|
|
|
|
| 96 |
|
| 97 |
chat_history = get_chat_history(history)
|
| 98 |
chat_images = get_chat_images(history)
|
|
@@ -103,6 +106,9 @@ def bot(history):
|
|
| 103 |
"do_sample": False
|
| 104 |
}
|
| 105 |
|
|
|
|
|
|
|
|
|
|
| 106 |
response = generate_stream(None, chat_images, chat_history, **generation_kwargs)
|
| 107 |
for _output in response:
|
| 108 |
history[-1][1] = _output
|
|
|
|
| 93 |
gr.Warning("The number of images uploaded is less than the number of <image> placeholders in the text. Will automatically remove extra <image> placeholders from the text.")
|
| 94 |
cur_messages['text'] = cur_messages['text'][::-1].replace("<image>"[::-1], "", cur_messages['text'].count("<image>") - len(cur_messages['images']))[::-1]
|
| 95 |
history[-1][0] = cur_messages["text"]
|
| 96 |
+
|
| 97 |
+
print(cur_messages)
|
| 98 |
+
|
| 99 |
|
| 100 |
chat_history = get_chat_history(history)
|
| 101 |
chat_images = get_chat_images(history)
|
|
|
|
| 106 |
"do_sample": False
|
| 107 |
}
|
| 108 |
|
| 109 |
+
print(chat_history)
|
| 110 |
+
print(chat_images)
|
| 111 |
+
|
| 112 |
response = generate_stream(None, chat_images, chat_history, **generation_kwargs)
|
| 113 |
for _output in response:
|
| 114 |
history[-1][1] = _output
|