Update app.py
Browse files
app.py
CHANGED
|
@@ -157,11 +157,13 @@ def predict(_chatbot, task_history) -> tuple:
|
|
| 157 |
else:
|
| 158 |
task_history.append((chat_query, response))
|
| 159 |
else:
|
| 160 |
-
|
|
|
|
| 161 |
if task_history:
|
| 162 |
-
task_history[-1] = (chat_query,
|
| 163 |
else:
|
| 164 |
-
task_history.append((chat_query,
|
|
|
|
| 165 |
return _chatbot, task_history
|
| 166 |
|
| 167 |
def save_uploaded_image(image_file, upload_dir):
|
|
|
|
| 157 |
else:
|
| 158 |
task_history.append((chat_query, response))
|
| 159 |
else:
|
| 160 |
+
text_response = response.strip() # Ensure it's just a string
|
| 161 |
+
_chatbot[-1] = (chat_query, text_response)
|
| 162 |
if task_history:
|
| 163 |
+
task_history[-1] = (chat_query, text_response)
|
| 164 |
else:
|
| 165 |
+
task_history.append((chat_query, text_response))
|
| 166 |
+
|
| 167 |
return _chatbot, task_history
|
| 168 |
|
| 169 |
def save_uploaded_image(image_file, upload_dir):
|