Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -80,9 +80,14 @@ class FalconChatBot:
|
|
| 80 |
user_message = message["user"]
|
| 81 |
assistant_message = message["assistant"]
|
| 82 |
conversation += f"Falcon:{' ' + assistant_message if assistant_message else ''} User: {user_message}\n Falcon:\n"
|
|
|
|
|
|
|
| 83 |
|
| 84 |
-
|
|
|
|
|
|
|
| 85 |
|
|
|
|
| 86 |
|
| 87 |
|
| 88 |
# Create the Falcon chatbot instance
|
|
|
|
| 80 |
user_message = message["user"]
|
| 81 |
assistant_message = message["assistant"]
|
| 82 |
conversation += f"Falcon:{' ' + assistant_message if assistant_message else ''} User: {user_message}\n Falcon:\n"
|
| 83 |
+
# Decode the generated response to text
|
| 84 |
+
response_text = tokenizer.decode(response[0], skip_special_tokens=True)
|
| 85 |
|
| 86 |
+
# Append the Falcon-like conversation to the history
|
| 87 |
+
self.history.append(formatted_input)
|
| 88 |
+
self.history.append(response_text)
|
| 89 |
|
| 90 |
+
return response_text
|
| 91 |
|
| 92 |
|
| 93 |
# Create the Falcon chatbot instance
|