From f8a01ef70a86558b5f429b42631b590c29f8e2f8 Mon Sep 17 00:00:00 2001 From: Silen Naihin Date: Tue, 1 Aug 2023 17:15:15 +0100 Subject: [PATCH] fixing combined charts issue --- agbenchmark/agent_interface.py | 2 +- .../reports/processing/gen_combined_chart.py | 4 +++- agbenchmark/reports/processing/process_report.py | 13 ++++--------- agent/SuperAGI | 2 +- 4 files changed, 9 insertions(+), 12 deletions(-) diff --git a/agbenchmark/agent_interface.py b/agbenchmark/agent_interface.py index adcd29447..1532bd1e0 100644 --- a/agbenchmark/agent_interface.py +++ b/agbenchmark/agent_interface.py @@ -54,7 +54,7 @@ def run_agent( output = process.stdout.readline() print(output.strip()) except Exception as e: - print("Error reading stdout", e) + continue # Check if process has ended, has no more output, or exceeded timeout if process.poll() is not None or (time.time() - start_time > timeout): diff --git a/agbenchmark/reports/processing/gen_combined_chart.py b/agbenchmark/reports/processing/gen_combined_chart.py index ca6ede7d7..0cc96d91a 100644 --- a/agbenchmark/reports/processing/gen_combined_chart.py +++ b/agbenchmark/reports/processing/gen_combined_chart.py @@ -19,7 +19,9 @@ def generate_combined_chart() -> None: reports_data = get_reports_data(str(all_agents_path)) - categories = all_agent_categories(reports_data, combined=True) + categories = all_agent_categories(reports_data) + + print("Agent categories:", categories) # Count the number of directories in this directory num_dirs = len([f for f in combined_charts_folder.iterdir() if f.is_dir()]) diff --git a/agbenchmark/reports/processing/process_report.py b/agbenchmark/reports/processing/process_report.py index 2c5f3f59c..ac8729af6 100644 --- a/agbenchmark/reports/processing/process_report.py +++ b/agbenchmark/reports/processing/process_report.py @@ -31,17 +31,14 @@ def get_reports_data(report_path: str) -> dict[str, Any]: return reports_data -def get_agent_category( - report: Report, combined: Optional[bool] = None -) -> dict[str, Any]: +def get_agent_category(report: Report) -> dict[str, Any]: categories: dict[str, Any] = {} def get_highest_category_difficulty(data: Test) -> None: for category in data.category: if category == "interface" or category == "iterate": continue - if combined: - categories.setdefault(category, 0) + categories.setdefault(category, 0) if data.metrics.success: num_dif = STRING_DIFFICULTY_MAP[data.metrics.difficulty] if num_dif > categories.setdefault(category, 0): @@ -57,13 +54,11 @@ def get_agent_category( return categories -def all_agent_categories( - reports_data: dict[str, Any], combined: Optional[bool] = None -) -> dict[str, Any]: +def all_agent_categories(reports_data: dict[str, Any]) -> dict[str, Any]: all_categories: dict[str, Any] = {} for name, report in reports_data.items(): - categories = get_agent_category(report, combined) + categories = get_agent_category(report) all_categories[name] = categories return all_categories diff --git a/agent/SuperAGI b/agent/SuperAGI index 646f33a76..b0318053b 160000 --- a/agent/SuperAGI +++ b/agent/SuperAGI @@ -1 +1 @@ -Subproject commit 646f33a761d8332821aeb4a5dc167b619d907c50 +Subproject commit b0318053b6cbe357f2e020fe0f1275a2cb3da767