From beab473b40714fbd802ebb3b61c0dd3d3ba7d91a Mon Sep 17 00:00:00 2001 From: XianBW <36835909+XianBW@users.noreply.github.com> Date: Tue, 2 Sep 2025 17:06:54 +0800 Subject: [PATCH] fix: summary page bug (#1219) * fix summary bug * fix CI --- rdagent/log/ui/ds_summary.py | 3 +++ rdagent/log/ui/utils.py | 8 +++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/rdagent/log/ui/ds_summary.py b/rdagent/log/ui/ds_summary.py index 8bd398f4..0de0355c 100755 --- a/rdagent/log/ui/ds_summary.py +++ b/rdagent/log/ui/ds_summary.py @@ -202,4 +202,7 @@ with st.container(border=True): try: all_summarize_win() except Exception as e: + import traceback + st.error(f"Error occurred when show summary:\n{e}") + st.code(traceback.format_exc()) diff --git a/rdagent/log/ui/utils.py b/rdagent/log/ui/utils.py index a872b91c..7696386c 100644 --- a/rdagent/log/ui/utils.py +++ b/rdagent/log/ui/utils.py @@ -263,7 +263,7 @@ def _get_score_stat_hash_func(log_path: Path, sota_loop_id: int) -> str: return _log_path_hash_func(log_path) + str(sota_loop_id) -def get_score_stat(log_path: Path, sota_loop_id: int) -> tuple[float | None, float | None, bool, float | None]: +def get_score_stat(log_path: Path, sota_loop_id: int) -> tuple[float | None, float | None, bool | None, float | None]: """ Get the scores before and after merge period. @@ -298,8 +298,10 @@ def get_score_stat(log_path: Path, sota_loop_id: int) -> tuple[float | None, flo total_merge_loops = 0 log_storage = FileStorage(log_path) all_trace = list(log_storage.iter_msg(tag="trace")) - final_trace = all_trace[-1].content - + if all_trace: + final_trace = all_trace[-1].content + else: + return None, None, None, None for loop_index, (exp, fb) in enumerate(final_trace.hist): if hasattr(final_trace, "idx2loop_id"): loop_id = final_trace.idx2loop_id[loop_index]