Spaces:
Running
Running
inject assistant placeholder at right time
Browse files
app.py
CHANGED
|
@@ -138,9 +138,6 @@ def chat_response(user_msg, chat_history, system_prompt,
|
|
| 138 |
else:
|
| 139 |
debug = 'Web search disabled.'
|
| 140 |
|
| 141 |
-
# Prepare assistant placeholder
|
| 142 |
-
# history.append({'role': 'assistant', 'content': ''})
|
| 143 |
-
|
| 144 |
try:
|
| 145 |
|
| 146 |
# merge any fetched search results into the system prompt
|
|
@@ -187,6 +184,8 @@ def chat_response(user_msg, chat_history, system_prompt,
|
|
| 187 |
gen_thread.start()
|
| 188 |
|
| 189 |
assistant_text = ''
|
|
|
|
|
|
|
| 190 |
for chunk in streamer:
|
| 191 |
if cancel_event.is_set():
|
| 192 |
break
|
|
|
|
| 138 |
else:
|
| 139 |
debug = 'Web search disabled.'
|
| 140 |
|
|
|
|
|
|
|
|
|
|
| 141 |
try:
|
| 142 |
|
| 143 |
# merge any fetched search results into the system prompt
|
|
|
|
| 184 |
gen_thread.start()
|
| 185 |
|
| 186 |
assistant_text = ''
|
| 187 |
+
# Prepare assistant placeholder
|
| 188 |
+
history.append({'role': 'assistant', 'content': ''})
|
| 189 |
for chunk in streamer:
|
| 190 |
if cancel_event.is_set():
|
| 191 |
break
|