openhands openhands commited on
Commit
044cdf4
·
1 Parent(s): 8be216f

Add debug logging to track data loading on HuggingFace Space

Browse files

- Add data integrity check in setup_data.py
- Add sample data logging in simple_data_loader.py
- This will help identify where the zero scores are coming from

Co-authored-by: openhands <[email protected]>

Files changed (2) hide show
  1. setup_data.py +9 -0
  2. simple_data_loader.py +7 -0
setup_data.py CHANGED
@@ -69,6 +69,15 @@ def fetch_data_from_github():
69
  shutil.copytree(results_source, target_results)
70
 
71
  print(f"Successfully fetched data from GitHub. Files: {list(target_dir.glob('*'))}")
 
 
 
 
 
 
 
 
 
72
  return True
73
 
74
  except subprocess.TimeoutExpired:
 
69
  shutil.copytree(results_source, target_results)
70
 
71
  print(f"Successfully fetched data from GitHub. Files: {list(target_dir.glob('*'))}")
72
+
73
+ # Verify data integrity by checking a sample agent
74
+ sample_agents = list(target_results.glob("*/scores.json"))
75
+ if sample_agents:
76
+ import json
77
+ with open(sample_agents[0]) as f:
78
+ sample_data = json.load(f)
79
+ print(f"Sample data from {sample_agents[0].parent.name}: {sample_data[0] if sample_data else 'EMPTY'}")
80
+
81
  return True
82
 
83
  except subprocess.TimeoutExpired:
simple_data_loader.py CHANGED
@@ -206,6 +206,13 @@ class SimpleLeaderboardViewer:
206
  # Simple mapping: each tag maps to itself
207
  self.tag_map = {tag: [tag] for tag in sorted(all_tags)}
208
 
 
 
 
 
 
 
 
209
  return transformed_df, self.tag_map
210
  except Exception as e:
211
  import traceback
 
206
  # Simple mapping: each tag maps to itself
207
  self.tag_map = {tag: [tag] for tag in sorted(all_tags)}
208
 
209
+ # DEBUG: Print sample of loaded data
210
+ print(f"[DATA_LOADER] Loaded {len(transformed_df)} agents")
211
+ if len(transformed_df) > 0:
212
+ sample_cols = ['agent_name', 'overall_score', 'overall_cost']
213
+ available_cols = [c for c in sample_cols if c in transformed_df.columns]
214
+ print(f"[DATA_LOADER] Sample row: {transformed_df[available_cols].iloc[0].to_dict()}")
215
+
216
  return transformed_df, self.tag_map
217
  except Exception as e:
218
  import traceback