Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -61,7 +61,7 @@ def calculate_eou(chat_ctx, session):
|
|
61 |
return probs[eou_token_id]
|
62 |
|
63 |
# Chatbot logic with EOU
|
64 |
-
messages = []
|
65 |
|
66 |
def chatbot(user_input):
|
67 |
global messages
|
@@ -71,6 +71,7 @@ def chatbot(user_input):
|
|
71 |
messages = [] # Reset conversation history
|
72 |
return "Chat ended. Refresh the page to start again."
|
73 |
|
|
|
74 |
# Add user message to conversation history
|
75 |
messages.append({"role": "user", "content": user_input})
|
76 |
|
|
|
61 |
return probs[eou_token_id]
|
62 |
|
63 |
# Chatbot logic with EOU
|
64 |
+
messages = [{"role": "system", "content": os.environ.get("CHARACTER_DESC", "You are a helpful assistant.")}]
|
65 |
|
66 |
def chatbot(user_input):
|
67 |
global messages
|
|
|
71 |
messages = [] # Reset conversation history
|
72 |
return "Chat ended. Refresh the page to start again."
|
73 |
|
74 |
+
|
75 |
# Add user message to conversation history
|
76 |
messages.append({"role": "user", "content": user_input})
|
77 |
|