Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -189,9 +189,9 @@ def answer_question(user_question):
|
|
189 |
|
190 |
return response_text
|
191 |
|
192 |
-
|
193 |
iterations = 0
|
194 |
-
|
195 |
while iterations < max_iterations:
|
196 |
response = agent_executor.invoke({"input": user_question})
|
197 |
if isinstance(response, dict):
|
@@ -201,15 +201,15 @@ def answer_question(user_question):
|
|
201 |
if "invalid" not in response_text.lower():
|
202 |
break
|
203 |
iterations += 1
|
204 |
-
|
205 |
if iterations == max_iterations:
|
206 |
return "The agent could not generate a valid response within the iteration limit."
|
207 |
-
|
208 |
# Print memory buffer for debugging
|
209 |
print("Memory Buffer:", memory.buffer)
|
210 |
# Print memory buffer for debugging
|
211 |
print("Memory Buffer11:", memory.load_memory_variables({}))
|
212 |
-
'''
|
213 |
|
214 |
# Create the Gradio interface
|
215 |
iface = gr.Interface(
|
|
|
189 |
|
190 |
return response_text
|
191 |
|
192 |
+
''' global iterations
|
193 |
iterations = 0
|
194 |
+
|
195 |
while iterations < max_iterations:
|
196 |
response = agent_executor.invoke({"input": user_question})
|
197 |
if isinstance(response, dict):
|
|
|
201 |
if "invalid" not in response_text.lower():
|
202 |
break
|
203 |
iterations += 1
|
204 |
+
|
205 |
if iterations == max_iterations:
|
206 |
return "The agent could not generate a valid response within the iteration limit."
|
207 |
+
|
208 |
# Print memory buffer for debugging
|
209 |
print("Memory Buffer:", memory.buffer)
|
210 |
# Print memory buffer for debugging
|
211 |
print("Memory Buffer11:", memory.load_memory_variables({}))
|
212 |
+
'''
|
213 |
|
214 |
# Create the Gradio interface
|
215 |
iface = gr.Interface(
|