Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -17,14 +17,12 @@ async def direct_regenerate(model, user_input, chatbot):
|
|
17 |
adapter = next(entry['adapter'] for entry in chatbots_data if entry['original_model'] == model)
|
18 |
temp_state = {
|
19 |
"history": [
|
20 |
-
[{"role": "user", "content":
|
21 |
]
|
22 |
}
|
23 |
response = await get_bot_response(adapter, user_input, temp_state, 0)
|
24 |
-
chatbot[-1] = (
|
25 |
return "", chatbot
|
26 |
-
|
27 |
-
|
28 |
password=os.environ.get("MONGODB")
|
29 |
|
30 |
def init_database():
|
|
|
17 |
adapter = next(entry['adapter'] for entry in chatbots_data if entry['original_model'] == model)
|
18 |
temp_state = {
|
19 |
"history": [
|
20 |
+
[{"role": "user", "content": chatbot[-1][0]}] # Keep the user's last message
|
21 |
]
|
22 |
}
|
23 |
response = await get_bot_response(adapter, user_input, temp_state, 0)
|
24 |
+
chatbot[-1] = (chatbot[-1][0], response) # Update only the assistant's response
|
25 |
return "", chatbot
|
|
|
|
|
26 |
password=os.environ.get("MONGODB")
|
27 |
|
28 |
def init_database():
|