@@ -142,6 +142,10 @@ def filter_agent_id(self, agent_id: list[tuple]):
142142 max-height: 400px;
143143 overflow-y: auto;
144144}
145+ .error-report {
146+ max-height: 700px;
147+ overflow-y: auto;
148+ }
145149.my-code-view {
146150 max-height: 300px;
147151 overflow-y: auto;
@@ -284,6 +288,8 @@ def run_gradio(results_dir: Path):
284288 with gr .Tab ("Global Stats" ):
285289 global_stats = gr .DataFrame (max_height = 500 , show_label = False , interactive = False )
286290
291+ with gr .Tab ("Error Report" ):
292+ error_report = gr .Markdown (elem_classes = "error-report" , show_copy_button = True )
287293 with gr .Row ():
288294 episode_info = gr .Markdown (label = "Episode Info" , elem_classes = "my-markdown" )
289295 action_info = gr .Markdown (label = "Action Info" , elem_classes = "my-markdown" )
@@ -411,7 +417,7 @@ def run_gradio(results_dir: Path):
411417 exp_dir_choice .change (
412418 fn = new_exp_dir ,
413419 inputs = exp_dir_choice ,
414- outputs = [agent_table , agent_id , constants , variables , global_stats ],
420+ outputs = [agent_table , agent_id , constants , variables , global_stats , error_report ],
415421 )
416422
417423 agent_table .select (fn = on_select_agent , inputs = agent_table , outputs = [agent_id ])
@@ -918,19 +924,24 @@ def get_agent_report(result_df: pd.DataFrame):
918924
919925
920926def update_global_stats ():
921- global info
922927 stats = inspect_results .global_report (info .result_df , reduce_fn = inspect_results .summarize_stats )
923928 stats .reset_index (inplace = True )
924929 return stats
925930
926931
932+ def update_error_report ():
933+ report_files = list (info .exp_list_dir .glob ("error_report*.md" ))
934+ if len (report_files ) == 0 :
935+ return "No error report found"
936+ report_files = sorted (report_files , key = os .path .getctime , reverse = True )
937+ return report_files [0 ].read_text ()
938+
927939def new_exp_dir (exp_dir , progress = gr .Progress (), just_refresh = False ):
928940
929941 if exp_dir == select_dir_instructions :
930942 return None , None
931943
932944 exp_dir = exp_dir .split (" - " )[0 ]
933- global info
934945
935946 if len (exp_dir ) == 0 :
936947 info .exp_list_dir = None
@@ -951,7 +962,7 @@ def new_exp_dir(exp_dir, progress=gr.Progress(), just_refresh=False):
951962 agent_id = info .get_agent_id (agent_report .iloc [0 ])
952963
953964 constants , variables = format_constant_and_variables ()
954- return agent_report , agent_id , constants , variables , update_global_stats ()
965+ return agent_report , agent_id , constants , variables , update_global_stats (), update_error_report ()
955966
956967
957968def new_agent_id (agent_id : list [tuple ]):
0 commit comments