Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -180,7 +180,7 @@ iterations = 0
|
|
180 |
|
181 |
def answer_question(user_question):
|
182 |
|
183 |
-
|
184 |
iterations = 0
|
185 |
|
186 |
while iterations < max_iterations:
|
@@ -200,8 +200,13 @@ def answer_question(user_question):
|
|
200 |
print("Memory Buffer:", memory.buffer)
|
201 |
# Print memory buffer for debugging
|
202 |
print("Memory Buffer11:", memory.load_memory_variables({}))
|
203 |
-
|
204 |
# Format the response text
|
|
|
|
|
|
|
|
|
|
|
205 |
response_text = response_text.replace('\n', ' ').replace(' ', ' ').strip()
|
206 |
|
207 |
return response_text
|
|
|
180 |
|
181 |
def answer_question(user_question):
|
182 |
|
183 |
+
''' global iterations
|
184 |
iterations = 0
|
185 |
|
186 |
while iterations < max_iterations:
|
|
|
200 |
print("Memory Buffer:", memory.buffer)
|
201 |
# Print memory buffer for debugging
|
202 |
print("Memory Buffer11:", memory.load_memory_variables({}))
|
203 |
+
'''
|
204 |
# Format the response text
|
205 |
+
response = agent_executor.invoke({"input": user_question})
|
206 |
+
if isinstance(response, dict):
|
207 |
+
response_text = response.get("output", "")
|
208 |
+
else:
|
209 |
+
response_text = response
|
210 |
response_text = response_text.replace('\n', ' ').replace(' ', ' ').strip()
|
211 |
|
212 |
return response_text
|