Spaces:
Runtime error
Runtime error
Update response perf.
Browse files
app.py
CHANGED
|
@@ -66,7 +66,6 @@ def get_chat_response(chatbot, task_history, model, tokenizer):
|
|
| 66 |
history_filter.append((pre, a))
|
| 67 |
pre = ""
|
| 68 |
history, message = history_filter[:-1], history_filter[-1][0]
|
| 69 |
-
|
| 70 |
response, history = model.chat(tokenizer, message, history=history)
|
| 71 |
image = tokenizer.draw_bbox_on_latest_picture(response, history)
|
| 72 |
if image is not None:
|
|
@@ -83,8 +82,10 @@ def get_chat_response(chatbot, task_history, model, tokenizer):
|
|
| 83 |
if chat_response != "":
|
| 84 |
chatbot.append((None, chat_response))
|
| 85 |
else:
|
| 86 |
-
chatbot[-1] = (format_text(chat_query), response)
|
| 87 |
-
full_response = format_text(response)
|
|
|
|
|
|
|
| 88 |
|
| 89 |
task_history.append((message, full_response))
|
| 90 |
chatbot.append((format_text(message), format_text(full_response))) # Hier verwenden wir format_text statt _parse_text
|
|
|
|
| 66 |
history_filter.append((pre, a))
|
| 67 |
pre = ""
|
| 68 |
history, message = history_filter[:-1], history_filter[-1][0]
|
|
|
|
| 69 |
response, history = model.chat(tokenizer, message, history=history)
|
| 70 |
image = tokenizer.draw_bbox_on_latest_picture(response, history)
|
| 71 |
if image is not None:
|
|
|
|
| 82 |
if chat_response != "":
|
| 83 |
chatbot.append((None, chat_response))
|
| 84 |
else:
|
| 85 |
+
chatbot[-1] = (format_text(chat_query), response)
|
| 86 |
+
full_response = format_text(response)
|
| 87 |
+
task_history[-1] = (query, full_response)
|
| 88 |
+
return chatbot
|
| 89 |
|
| 90 |
task_history.append((message, full_response))
|
| 91 |
chatbot.append((format_text(message), format_text(full_response))) # Hier verwenden wir format_text statt _parse_text
|