Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -194,6 +194,14 @@ def generate_response(user_input, top_p, temperature, chat_counter, chatbot, his
|
|
| 194 |
history.append({"role": "user", "content": user_input})
|
| 195 |
history.append({"role": "assistant", "content": response_text})
|
| 196 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 197 |
chat_counter += 1
|
| 198 |
return history, history, chat_counter, "✅ Success", gr.update(value="", interactive=True), gr.update(interactive=True)
|
| 199 |
|
|
|
|
| 194 |
history.append({"role": "user", "content": user_input})
|
| 195 |
history.append({"role": "assistant", "content": response_text})
|
| 196 |
|
| 197 |
+
chatbot_messages = []
|
| 198 |
+
for i in range(0, len(history), 2):
|
| 199 |
+
if i + 1 < len(history):
|
| 200 |
+
user_msg = history[i]["content"]
|
| 201 |
+
bot_msg = history[i + 1]["content"]
|
| 202 |
+
chatbot_messages.append([user_msg, bot_msg])
|
| 203 |
+
|
| 204 |
+
|
| 205 |
chat_counter += 1
|
| 206 |
return history, history, chat_counter, "✅ Success", gr.update(value="", interactive=True), gr.update(interactive=True)
|
| 207 |
|