Tonic commited on
Commit
7e8c4e1
·
1 Parent(s): c6878b9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
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
- _chatbot[-1] = (chat_query, response)
 
161
  if task_history:
162
- task_history[-1] = (chat_query, response)
163
  else:
164
- task_history.append((chat_query, response))
 
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):