Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
|