Update app.py
Browse files
app.py
CHANGED
@@ -116,7 +116,13 @@ def _launch_demo(args, model, tokenizer):
|
|
116 |
query = {'text': chat_query}
|
117 |
history_cp = copy.deepcopy(task_history)
|
118 |
full_response = ""
|
119 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
120 |
response, history = model.chat(tokenizer, query=query, history=history)
|
121 |
image = tokenizer.draw_bbox_on_latest_picture(response, history)
|
122 |
if image is not None:
|
|
|
116 |
query = {'text': chat_query}
|
117 |
history_cp = copy.deepcopy(task_history)
|
118 |
full_response = ""
|
119 |
+
processed_history = []
|
120 |
+
for item in task_history:
|
121 |
+
if isinstance(item, tuple) and len(item) == 2:
|
122 |
+
processed_history.append(item)
|
123 |
+
else:
|
124 |
+
print("Invalid history item:", item)
|
125 |
+
history = process_history_for_model(processed_history)
|
126 |
response, history = model.chat(tokenizer, query=query, history=history)
|
127 |
image = tokenizer.draw_bbox_on_latest_picture(response, history)
|
128 |
if image is not None:
|