Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -282,32 +282,32 @@ def add_message(history, message):
|
|
282 |
history = []
|
283 |
our_chatbot = chat_manager.get_chatbot(args, model_path, tokenizer, model, image_processor, context_len)
|
284 |
chat_image_num = 0
|
285 |
-
|
286 |
-
if len(message["files"]) <= 1:
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
|
299 |
-
|
300 |
-
|
301 |
|
302 |
-
|
303 |
-
|
304 |
-
else:
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
|
312 |
|
313 |
@spaces.GPU
|
|
|
282 |
history = []
|
283 |
our_chatbot = chat_manager.get_chatbot(args, model_path, tokenizer, model, image_processor, context_len)
|
284 |
chat_image_num = 0
|
285 |
+
|
286 |
+
# if len(message["files"]) <= 1:
|
287 |
+
# for x in message["files"]:
|
288 |
+
# history.append(((x,), None))
|
289 |
+
# chat_image_num += 1
|
290 |
+
# if chat_image_num > 1:
|
291 |
+
# history = []
|
292 |
+
# chat_manager.reset_chatbot()
|
293 |
+
# our_chatbot = chat_manager.get_chatbot(args, model_path, tokenizer, model, image_processor, context_len)
|
294 |
+
# chat_image_num = 0
|
295 |
+
# for x in message["files"]:
|
296 |
+
# history.append(((x,), None))
|
297 |
+
# chat_image_num += 1
|
298 |
|
299 |
+
# if message["text"] is not None:
|
300 |
+
# history.append((message["text"], None))
|
301 |
|
302 |
+
# print(f"### Chatbot instance ID: {id(our_chatbot)}")
|
303 |
+
# return history, gr.MultimodalTextbox(value=None, interactive=False)
|
304 |
+
# else:
|
305 |
+
for x in message["files"]:
|
306 |
+
history.append(((x,), None))
|
307 |
+
if message["text"] is not None:
|
308 |
+
history.append((message["text"], None))
|
309 |
+
print(f"### Chatbot instance ID: {id(our_chatbot)}")
|
310 |
+
return history, gr.MultimodalTextbox(value=None, interactive=False)
|
311 |
|
312 |
|
313 |
@spaces.GPU
|