loop fix
Browse files
ControllerExecutorFlow.py
CHANGED
@@ -105,7 +105,6 @@ class ControllerExecutorFlow(CompositeFlow):
|
|
105 |
def _on_reach_max_round(self):
|
106 |
""" This method is called when the flow reaches the maximum amount of rounds. It updates the state of the flow and starts the process of terminating the flow."""
|
107 |
self._state_update_dict({
|
108 |
-
"EARLY_EXIT": False,
|
109 |
"answer": "The maximum amount of rounds was reached before the model found an answer.",
|
110 |
"status": "unfinished"
|
111 |
})
|
@@ -180,12 +179,12 @@ class ControllerExecutorFlow(CompositeFlow):
|
|
180 |
|
181 |
self._state_update_dict(
|
182 |
{
|
183 |
-
"
|
184 |
"answer": self.flow_state["command_args"]["answer"],
|
185 |
"status": "finished"
|
186 |
}
|
187 |
)
|
188 |
-
|
189 |
|
190 |
|
191 |
|
@@ -214,5 +213,9 @@ class ControllerExecutorFlow(CompositeFlow):
|
|
214 |
self._on_reach_max_round()
|
215 |
self.generate_reply()
|
216 |
|
217 |
-
|
|
|
|
|
|
|
|
|
218 |
|
|
|
105 |
def _on_reach_max_round(self):
|
106 |
""" This method is called when the flow reaches the maximum amount of rounds. It updates the state of the flow and starts the process of terminating the flow."""
|
107 |
self._state_update_dict({
|
|
|
108 |
"answer": "The maximum amount of rounds was reached before the model found an answer.",
|
109 |
"status": "unfinished"
|
110 |
})
|
|
|
179 |
|
180 |
self._state_update_dict(
|
181 |
{
|
182 |
+
"early_exit_flag": True,
|
183 |
"answer": self.flow_state["command_args"]["answer"],
|
184 |
"status": "finished"
|
185 |
}
|
186 |
)
|
187 |
+
|
188 |
|
189 |
|
190 |
|
|
|
213 |
self._on_reach_max_round()
|
214 |
self.generate_reply()
|
215 |
|
216 |
+
|
217 |
+
if self.flow_state.get("early_exit_flag",False) or current_state is None:
|
218 |
+
self.flow_state["last_state"] = None
|
219 |
+
else:
|
220 |
+
self.flow_state["last_state"] = current_state
|
221 |
|