Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -76,11 +76,20 @@ except Exception as e:
|
|
76 |
raise
|
77 |
|
78 |
# Configure system message
|
79 |
-
system_message = """You are
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
|
85 |
# Constants for water consumption calculation
|
86 |
WATER_PER_TOKEN = {
|
|
|
76 |
raise
|
77 |
|
78 |
# Configure system message
|
79 |
+
system_message = """You are a helpful AI assistant called AQuaBot. You provide direct, clear answers to questions while being aware of environmental impact. Keep your responses natural and concise. Respond directly to questions without using any special tags or markers."""
|
80 |
+
|
81 |
+
def generate_response(user_input, chat_history):
|
82 |
+
try:
|
83 |
+
logger.info("Generating response for user input...")
|
84 |
+
global total_water_consumption
|
85 |
+
|
86 |
+
# Calculate water consumption for input
|
87 |
+
input_water_consumption = calculate_water_consumption(user_input, True)
|
88 |
+
total_water_consumption += input_water_consumption
|
89 |
+
|
90 |
+
# Create prompt following Llama 2 chat format
|
91 |
+
conversation = f""<s>[INST] {system_message}
|
92 |
+
|
93 |
|
94 |
# Constants for water consumption calculation
|
95 |
WATER_PER_TOKEN = {
|