sanuth123 commited on
Commit
451de25
·
verified ·
1 Parent(s): 16d82ce

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -60,7 +60,12 @@ def respond(
60
 
61
  # Extract the answer from the response
62
  answer = response['answer']
63
-
 
 
 
 
 
64
  # Add conversation to history
65
  history.append((message, answer))
66
 
 
60
 
61
  # Extract the answer from the response
62
  answer = response['answer']
63
+
64
+ # Ensure that the answer is a string
65
+ if isinstance(answer, list):
66
+ answer = ' '.join([str(item) for item in answer]) # Convert list to string
67
+ elif isinstance(answer, tuple):
68
+ answer = ' '.join([str(item) for item in answer])
69
  # Add conversation to history
70
  history.append((message, answer))
71