Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -22,9 +22,13 @@ def generate_response(prompt, chat_history):
|
|
| 22 |
# Preprocess chat history to include thinking tags
|
| 23 |
processed_chat_history = []
|
| 24 |
for message in chat_history:
|
| 25 |
-
# Skipping Thought Process in history
|
| 26 |
-
if message["role"] == "assistant"
|
| 27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
else:
|
| 29 |
processed_chat_history.append(message)
|
| 30 |
|
|
|
|
| 22 |
# Preprocess chat history to include thinking tags
|
| 23 |
processed_chat_history = []
|
| 24 |
for message in chat_history:
|
| 25 |
+
# Skipping Thought Process in history
|
| 26 |
+
if message["role"] == "assistant":
|
| 27 |
+
metadata = message.get("metadata", {})
|
| 28 |
+
if isinstance(metadata, dict) and metadata.get("title", "").startswith("Thought"):
|
| 29 |
+
pass
|
| 30 |
+
else:
|
| 31 |
+
processed_chat_history.append(message)
|
| 32 |
else:
|
| 33 |
processed_chat_history.append(message)
|
| 34 |
|