Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

Add Early Termination to runBenchmark on Benchmark Failure (#5267)

hunteraraujo80682b41cb62
diff --git a/frontend/lib/viewmodels/skill_tree_viewmodel.dart b/frontend/lib/viewmodels/skill_tree_viewmodel.dart
index d48fd2f9d8..70e7d61e8e 100644
--- a/frontend/lib/viewmodels/skill_tree_viewmodel.dart
+++ b/frontend/lib/viewmodels/skill_tree_viewmodel.dart
@@ -202,6 +202,13 @@ class SkillTreeViewModel extends ChangeNotifier {
(element) => element.keys.first.id == node.id,
);
nodeStatus[node] = successStatus;
+
+ // If successStatus is false, break out of the loop
+ if (!successStatus) {
+ print(
+ "Benchmark for node ${node.id} failed. Stopping all benchmarks.");
+ break;
+ }
}
} catch (e) {
print("Error while running benchmark: $e");