Yuxuan-Zhang-Dexter commited on
Commit
7bc8d30
·
1 Parent(s): f589e51

fix typo candy crash with candy crush

Browse files
app.py CHANGED
@@ -53,7 +53,7 @@ leaderboard_state = {
53
  "Super Mario Bros": True,
54
  "Sokoban": True,
55
  "2048": True,
56
- "Candy Crash": True,
57
  "Tetris (complete)": True,
58
  "Tetris (planning only)": True,
59
  "Ace Attorney": True
@@ -62,7 +62,7 @@ leaderboard_state = {
62
  "Super Mario Bros": False,
63
  "Sokoban": False,
64
  "2048": False,
65
- "Candy Crash": False,
66
  "Tetris (complete)": False,
67
  "Tetris (planning only)": False,
68
  "Ace Attorney": False
@@ -172,7 +172,7 @@ def update_leaderboard(mario_overall, mario_details,
172
  "Super Mario Bros": mario_overall,
173
  "Sokoban": sokoban_overall,
174
  "2048": _2048_overall,
175
- "Candy Crash": candy_overall,
176
  "Tetris (complete)": tetris_overall,
177
  "Tetris (planning only)": tetris_plan_overall,
178
  "Ace Attorney": ace_attorney_overall
@@ -182,7 +182,7 @@ def update_leaderboard(mario_overall, mario_details,
182
  "Super Mario Bros": mario_details,
183
  "Sokoban": sokoban_details,
184
  "2048": _2048_details,
185
- "Candy Crash": candy_details,
186
  "Tetris (complete)": tetris_details,
187
  "Tetris (planning only)": tetris_plan_details,
188
  "Ace Attorney": ace_attorney_details
@@ -269,7 +269,7 @@ def update_leaderboard(mario_overall, mario_details,
269
  "Super Mario Bros": current_overall["Super Mario Bros"],
270
  "Sokoban": current_overall["Sokoban"],
271
  "2048": current_overall["2048"],
272
- "Candy Crash": current_overall["Candy Crash"],
273
  "Tetris (complete)": current_overall["Tetris (complete)"],
274
  "Tetris (planning only)": current_overall["Tetris (planning only)"],
275
  "Ace Attorney": current_overall["Ace Attorney"]
@@ -284,7 +284,7 @@ def update_leaderboard(mario_overall, mario_details,
284
  df = get_sokoban_leaderboard(rank_data)
285
  elif leaderboard_state["current_game"] == "2048":
286
  df = get_2048_leaderboard(rank_data)
287
- elif leaderboard_state["current_game"] == "Candy Crash":
288
  df = get_candy_leaderboard(rank_data)
289
  elif leaderboard_state["current_game"] == "Tetris (complete)":
290
  df = get_tetris_leaderboard(rank_data)
@@ -316,7 +316,7 @@ def update_leaderboard(mario_overall, mario_details,
316
  current_overall["Super Mario Bros"], current_details["Super Mario Bros"],
317
  current_overall["Sokoban"], current_details["Sokoban"],
318
  current_overall["2048"], current_details["2048"],
319
- current_overall["Candy Crash"], current_details["Candy Crash"],
320
  current_overall["Tetris (complete)"], current_details["Tetris (complete)"],
321
  current_overall["Tetris (planning only)"], current_details["Tetris (planning only)"],
322
  current_overall["Ace Attorney"], current_details["Ace Attorney"])
@@ -351,7 +351,7 @@ def get_initial_state():
351
  "Super Mario Bros": True,
352
  "Sokoban": True,
353
  "2048": True,
354
- "Candy Crash": True,
355
  "Tetris (complete)": True,
356
  "Tetris (planning only)": True,
357
  "Ace Attorney": True
@@ -360,7 +360,7 @@ def get_initial_state():
360
  "Super Mario Bros": False,
361
  "Sokoban": False,
362
  "2048": False,
363
- "Candy Crash": False,
364
  "Tetris (complete)": False,
365
  "Tetris (planning only)": False,
366
  "Ace Attorney": False
@@ -375,7 +375,7 @@ def clear_filters():
375
  "Super Mario Bros": True,
376
  "Sokoban": True,
377
  "2048": True,
378
- "Candy Crash": True,
379
  "Tetris (complete)": True,
380
  "Tetris (planning only)": True,
381
  "Ace Attorney": True
@@ -515,7 +515,7 @@ def build_app():
515
  with gr.Blocks(css="""
516
  /* Fix for scrolling issues */
517
  html, body {
518
- overflow-y: hidden !important;
519
  overflow-x: hidden !important;
520
  width: 100% !important;
521
  height: 100% !important;
@@ -743,8 +743,8 @@ def build_app():
743
  newContent = newContent.replace(/Tetris\s+\(planning\s+only\)/g, 'Tetris<br>(planning)');
744
  }
745
 
746
- // Format Candy Crash header
747
- if (text.includes('Candy Crash')) {
748
  newContent = newContent.replace(/Candy\s+Crash/g, 'Candy<br>Crash');
749
  }
750
 
@@ -878,9 +878,9 @@ def build_app():
878
  _2048_overall = gr.Checkbox(label="2048 Score", value=True)
879
  _2048_details = gr.Checkbox(label="2048 Details", value=False)
880
  with gr.Column():
881
- gr.Markdown("**🍬 Candy Crash**")
882
- candy_overall = gr.Checkbox(label="Candy Crash Score", value=True)
883
- candy_details = gr.Checkbox(label="Candy Crash Details", value=False)
884
  with gr.Column():
885
  gr.Markdown("**🎯 Tetris (complete)**")
886
  tetris_overall = gr.Checkbox(label="Tetris (complete) Score", value=True)
@@ -916,7 +916,7 @@ def build_app():
916
  "Super Mario Bros": True,
917
  "Sokoban": True,
918
  "2048": True,
919
- "Candy Crash": True,
920
  "Tetris (complete)": True,
921
  "Tetris (planning only)": True,
922
  "Ace Attorney": True
 
53
  "Super Mario Bros": True,
54
  "Sokoban": True,
55
  "2048": True,
56
+ "Candy Crush": True,
57
  "Tetris (complete)": True,
58
  "Tetris (planning only)": True,
59
  "Ace Attorney": True
 
62
  "Super Mario Bros": False,
63
  "Sokoban": False,
64
  "2048": False,
65
+ "Candy Crush": False,
66
  "Tetris (complete)": False,
67
  "Tetris (planning only)": False,
68
  "Ace Attorney": False
 
172
  "Super Mario Bros": mario_overall,
173
  "Sokoban": sokoban_overall,
174
  "2048": _2048_overall,
175
+ "Candy Crush": candy_overall,
176
  "Tetris (complete)": tetris_overall,
177
  "Tetris (planning only)": tetris_plan_overall,
178
  "Ace Attorney": ace_attorney_overall
 
182
  "Super Mario Bros": mario_details,
183
  "Sokoban": sokoban_details,
184
  "2048": _2048_details,
185
+ "Candy Crush": candy_details,
186
  "Tetris (complete)": tetris_details,
187
  "Tetris (planning only)": tetris_plan_details,
188
  "Ace Attorney": ace_attorney_details
 
269
  "Super Mario Bros": current_overall["Super Mario Bros"],
270
  "Sokoban": current_overall["Sokoban"],
271
  "2048": current_overall["2048"],
272
+ "Candy Crush": current_overall["Candy Crush"],
273
  "Tetris (complete)": current_overall["Tetris (complete)"],
274
  "Tetris (planning only)": current_overall["Tetris (planning only)"],
275
  "Ace Attorney": current_overall["Ace Attorney"]
 
284
  df = get_sokoban_leaderboard(rank_data)
285
  elif leaderboard_state["current_game"] == "2048":
286
  df = get_2048_leaderboard(rank_data)
287
+ elif leaderboard_state["current_game"] == "Candy Crush":
288
  df = get_candy_leaderboard(rank_data)
289
  elif leaderboard_state["current_game"] == "Tetris (complete)":
290
  df = get_tetris_leaderboard(rank_data)
 
316
  current_overall["Super Mario Bros"], current_details["Super Mario Bros"],
317
  current_overall["Sokoban"], current_details["Sokoban"],
318
  current_overall["2048"], current_details["2048"],
319
+ current_overall["Candy Crush"], current_details["Candy Crush"],
320
  current_overall["Tetris (complete)"], current_details["Tetris (complete)"],
321
  current_overall["Tetris (planning only)"], current_details["Tetris (planning only)"],
322
  current_overall["Ace Attorney"], current_details["Ace Attorney"])
 
351
  "Super Mario Bros": True,
352
  "Sokoban": True,
353
  "2048": True,
354
+ "Candy Crush": True,
355
  "Tetris (complete)": True,
356
  "Tetris (planning only)": True,
357
  "Ace Attorney": True
 
360
  "Super Mario Bros": False,
361
  "Sokoban": False,
362
  "2048": False,
363
+ "Candy Crush": False,
364
  "Tetris (complete)": False,
365
  "Tetris (planning only)": False,
366
  "Ace Attorney": False
 
375
  "Super Mario Bros": True,
376
  "Sokoban": True,
377
  "2048": True,
378
+ "Candy Crush": True,
379
  "Tetris (complete)": True,
380
  "Tetris (planning only)": True,
381
  "Ace Attorney": True
 
515
  with gr.Blocks(css="""
516
  /* Fix for scrolling issues */
517
  html, body {
518
+ overflow-y: auto !important;
519
  overflow-x: hidden !important;
520
  width: 100% !important;
521
  height: 100% !important;
 
743
  newContent = newContent.replace(/Tetris\s+\(planning\s+only\)/g, 'Tetris<br>(planning)');
744
  }
745
 
746
+ // Format Candy Crush header
747
+ if (text.includes('Candy Crush')) {
748
  newContent = newContent.replace(/Candy\s+Crash/g, 'Candy<br>Crash');
749
  }
750
 
 
878
  _2048_overall = gr.Checkbox(label="2048 Score", value=True)
879
  _2048_details = gr.Checkbox(label="2048 Details", value=False)
880
  with gr.Column():
881
+ gr.Markdown("**🍬 Candy Crush**")
882
+ candy_overall = gr.Checkbox(label="Candy Crush Score", value=True)
883
+ candy_details = gr.Checkbox(label="Candy Crush Details", value=False)
884
  with gr.Column():
885
  gr.Markdown("**🎯 Tetris (complete)**")
886
  tetris_overall = gr.Checkbox(label="Tetris (complete) Score", value=True)
 
916
  "Super Mario Bros": True,
917
  "Sokoban": True,
918
  "2048": True,
919
+ "Candy Crush": True,
920
  "Tetris (complete)": True,
921
  "Tetris (planning only)": True,
922
  "Ace Attorney": True
assets/news.json CHANGED
@@ -4,7 +4,7 @@
4
  "date": "2025-04-15",
5
  "video_link": "https://www.youtube.com/watch?v=q8PMW870yp8",
6
  "twitter_text": "Ace Attorney AI Revolution: O1 & Gemini 2.5 Pro lead in courtroom reasoning, while GPT-4.1 matches older models. Cost analysis reveals Gemini 2.5 Pro's 6-15x efficiency over O1.",
7
- "twitter_link": "https://x.com/haoailab"
8
  },
9
  {
10
  "date": "2025-04-08",
 
4
  "date": "2025-04-15",
5
  "video_link": "https://www.youtube.com/watch?v=q8PMW870yp8",
6
  "twitter_text": "Ace Attorney AI Revolution: O1 & Gemini 2.5 Pro lead in courtroom reasoning, while GPT-4.1 matches older models. Cost analysis reveals Gemini 2.5 Pro's 6-15x efficiency over O1.",
7
+ "twitter_link": "https://x.com/haoailab/status/1912231343372812508"
8
  },
9
  {
10
  "date": "2025-04-08",
data_visualization.py CHANGED
@@ -22,7 +22,7 @@ GAME_SCORE_COLUMNS = {
22
  "Super Mario Bros": "Score",
23
  "Sokoban": "Levels Cracked",
24
  "2048": "Score",
25
- "Candy Crash": "Average Score",
26
  "Tetris (complete)": "Score",
27
  "Tetris (planning only)": "Score",
28
  "Ace Attorney": "Score"
@@ -76,7 +76,7 @@ def create_horizontal_bar_chart(df, game_name):
76
  elif game_name == "2048":
77
  score_col = "Score"
78
  df_sorted = df.sort_values(by=score_col, ascending=True)
79
- elif game_name == "Candy Crash":
80
  score_col = "Average Score"
81
  df_sorted = df.sort_values(by=score_col, ascending=True)
82
  elif game_name in ["Tetris (complete)", "Tetris (planning only)"]:
@@ -91,7 +91,7 @@ def create_horizontal_bar_chart(df, game_name):
91
  x = df_sorted[score_col]
92
  y = [f"{row['Player']} [{row['Organization']}]" for _, row in df_sorted.iterrows()]
93
  colors = [MODEL_COLORS.get(row['Player'], '#808080') for _, row in df_sorted.iterrows()]
94
- texts = [f"{v:.1f}" if game_name == "Candy Crash" else f"{int(v)}" for v in x]
95
 
96
  fig = go.Figure(go.Bar(
97
  x=x,
@@ -319,7 +319,7 @@ def hex_to_rgba(hex_color, alpha=0.2):
319
 
320
  def create_single_radar_chart(df, selected_games=None, highlight_models=None):
321
  if selected_games is None:
322
- selected_games = ['Super Mario Bros', '2048', 'Candy Crash', 'Sokoban', 'Ace Attorney']
323
 
324
  # Format game names
325
  formatted_games = []
 
22
  "Super Mario Bros": "Score",
23
  "Sokoban": "Levels Cracked",
24
  "2048": "Score",
25
+ "Candy Crush": "Average Score",
26
  "Tetris (complete)": "Score",
27
  "Tetris (planning only)": "Score",
28
  "Ace Attorney": "Score"
 
76
  elif game_name == "2048":
77
  score_col = "Score"
78
  df_sorted = df.sort_values(by=score_col, ascending=True)
79
+ elif game_name == "Candy Crush":
80
  score_col = "Average Score"
81
  df_sorted = df.sort_values(by=score_col, ascending=True)
82
  elif game_name in ["Tetris (complete)", "Tetris (planning only)"]:
 
91
  x = df_sorted[score_col]
92
  y = [f"{row['Player']} [{row['Organization']}]" for _, row in df_sorted.iterrows()]
93
  colors = [MODEL_COLORS.get(row['Player'], '#808080') for _, row in df_sorted.iterrows()]
94
+ texts = [f"{v:.1f}" if game_name == "Candy Crush" else f"{int(v)}" for v in x]
95
 
96
  fig = go.Figure(go.Bar(
97
  x=x,
 
319
 
320
  def create_single_radar_chart(df, selected_games=None, highlight_models=None):
321
  if selected_games is None:
322
+ selected_games = ['Super Mario Bros', '2048', 'Candy Crush', 'Sokoban', 'Ace Attorney']
323
 
324
  # Format game names
325
  formatted_games = []
gallery_tab.py CHANGED
@@ -16,7 +16,8 @@ def create_video_gallery():
16
  sokoban_id = VIDEO_LINKS["sokoban"].split("?v=")[1]
17
  game_2048_id = VIDEO_LINKS["2048"].split("?v=")[1]
18
  candy_id = VIDEO_LINKS["candy"].split("?v=")[1]
19
-
 
20
  # Get the latest video from news data
21
  latest_news = NEWS_DATA["news"][0] # First item is the latest
22
  latest_video_id = latest_news["video_link"].split("?v=")[1]
@@ -251,7 +252,13 @@ def create_video_gallery():
251
  <div class="video-wrapper">
252
  <iframe src="https://www.youtube.com/embed/{candy_id}"></iframe>
253
  </div>
254
- <div class="video-title">🍬 Candy Crash</div>
 
 
 
 
 
 
255
  </div>
256
  </div>
257
 
 
16
  sokoban_id = VIDEO_LINKS["sokoban"].split("?v=")[1]
17
  game_2048_id = VIDEO_LINKS["2048"].split("?v=")[1]
18
  candy_id = VIDEO_LINKS["candy"].split("?v=")[1]
19
+ ace_attorney_id = VIDEO_LINKS["ace_attorney"].split("?v=")[1]
20
+
21
  # Get the latest video from news data
22
  latest_news = NEWS_DATA["news"][0] # First item is the latest
23
  latest_video_id = latest_news["video_link"].split("?v=")[1]
 
252
  <div class="video-wrapper">
253
  <iframe src="https://www.youtube.com/embed/{candy_id}"></iframe>
254
  </div>
255
+ <div class="video-title">🍬 Candy Crush</div>
256
+ </div>
257
+ <div class="video-card">
258
+ <div class="video-wrapper">
259
+ <iframe src="https://www.youtube.com/embed/{ace_attorney_id}"></iframe>
260
+ </div>
261
+ <div class="video-title">⚖️ Ace Attorney</div>
262
  </div>
263
  </div>
264
 
leaderboard_utils.py CHANGED
@@ -7,7 +7,7 @@ GAME_ORDER = [
7
  "Super Mario Bros",
8
  "Sokoban",
9
  "2048",
10
- "Candy Crash",
11
  "Tetris (complete)",
12
  "Tetris (planning only)",
13
  "Ace Attorney"
@@ -67,7 +67,7 @@ def get_2048_leaderboard(rank_data):
67
  return df
68
 
69
  def get_candy_leaderboard(rank_data):
70
- data = rank_data.get("Candy Crash", {}).get("results", [])
71
  df = pd.DataFrame(data)
72
  df = df.rename(columns={
73
  "model": "Player",
@@ -129,8 +129,8 @@ def calculate_rank_and_completeness(rank_data, selected_games):
129
  game_dfs["Sokoban"] = get_sokoban_leaderboard(rank_data)
130
  if selected_games.get("2048"):
131
  game_dfs["2048"] = get_2048_leaderboard(rank_data)
132
- if selected_games.get("Candy Crash"):
133
- game_dfs["Candy Crash"] = get_candy_leaderboard(rank_data)
134
  if selected_games.get("Tetris (complete)"):
135
  game_dfs["Tetris (complete)"] = get_tetris_leaderboard(rank_data)
136
  if selected_games.get("Tetris (planning only)"):
@@ -180,7 +180,7 @@ def calculate_rank_and_completeness(rank_data, selected_games):
180
  elif game == "2048":
181
  player_score = df[df["Player"] == player]["Score"].iloc[0]
182
  rank = len(df[df["Score"] > player_score]) + 1
183
- elif game == "Candy Crash":
184
  player_score = df[df["Player"] == player]["Average Score"].iloc[0]
185
  rank = len(df[df["Average Score"] > player_score]) + 1
186
  elif game in ["Tetris (complete)", "Tetris (planning only)"]:
@@ -239,8 +239,8 @@ def get_combined_leaderboard(rank_data, selected_games):
239
  game_dfs["Sokoban"] = get_sokoban_leaderboard(rank_data)
240
  if selected_games.get("2048"):
241
  game_dfs["2048"] = get_2048_leaderboard(rank_data)
242
- if selected_games.get("Candy Crash"):
243
- game_dfs["Candy Crash"] = get_candy_leaderboard(rank_data)
244
  if selected_games.get("Tetris (complete)"):
245
  game_dfs["Tetris (complete)"] = get_tetris_leaderboard(rank_data)
246
  if selected_games.get("Tetris (planning only)"):
@@ -279,7 +279,7 @@ def get_combined_leaderboard(rank_data, selected_games):
279
  player_data[f"{game} Score"] = 0
280
  elif game == "2048":
281
  player_data[f"{game} Score"] = df[df["Player"] == player]["Score"].iloc[0]
282
- elif game == "Candy Crash":
283
  player_data[f"{game} Score"] = df[df["Player"] == player]["Average Score"].iloc[0]
284
  elif game in ["Tetris (complete)", "Tetris (planning only)"]:
285
  player_data[f"{game} Score"] = df[df["Player"] == player]["Score"].iloc[0]
 
7
  "Super Mario Bros",
8
  "Sokoban",
9
  "2048",
10
+ "Candy Crush",
11
  "Tetris (complete)",
12
  "Tetris (planning only)",
13
  "Ace Attorney"
 
67
  return df
68
 
69
  def get_candy_leaderboard(rank_data):
70
+ data = rank_data.get("Candy Crush", {}).get("results", [])
71
  df = pd.DataFrame(data)
72
  df = df.rename(columns={
73
  "model": "Player",
 
129
  game_dfs["Sokoban"] = get_sokoban_leaderboard(rank_data)
130
  if selected_games.get("2048"):
131
  game_dfs["2048"] = get_2048_leaderboard(rank_data)
132
+ if selected_games.get("Candy Crush"):
133
+ game_dfs["Candy Crush"] = get_candy_leaderboard(rank_data)
134
  if selected_games.get("Tetris (complete)"):
135
  game_dfs["Tetris (complete)"] = get_tetris_leaderboard(rank_data)
136
  if selected_games.get("Tetris (planning only)"):
 
180
  elif game == "2048":
181
  player_score = df[df["Player"] == player]["Score"].iloc[0]
182
  rank = len(df[df["Score"] > player_score]) + 1
183
+ elif game == "Candy Crush":
184
  player_score = df[df["Player"] == player]["Average Score"].iloc[0]
185
  rank = len(df[df["Average Score"] > player_score]) + 1
186
  elif game in ["Tetris (complete)", "Tetris (planning only)"]:
 
239
  game_dfs["Sokoban"] = get_sokoban_leaderboard(rank_data)
240
  if selected_games.get("2048"):
241
  game_dfs["2048"] = get_2048_leaderboard(rank_data)
242
+ if selected_games.get("Candy Crush"):
243
+ game_dfs["Candy Crush"] = get_candy_leaderboard(rank_data)
244
  if selected_games.get("Tetris (complete)"):
245
  game_dfs["Tetris (complete)"] = get_tetris_leaderboard(rank_data)
246
  if selected_games.get("Tetris (planning only)"):
 
279
  player_data[f"{game} Score"] = 0
280
  elif game == "2048":
281
  player_data[f"{game} Score"] = df[df["Player"] == player]["Score"].iloc[0]
282
+ elif game == "Candy Crush":
283
  player_data[f"{game} Score"] = df[df["Player"] == player]["Average Score"].iloc[0]
284
  elif game in ["Tetris (complete)", "Tetris (planning only)"]:
285
  player_data[f"{game} Score"] = df[df["Player"] == player]["Score"].iloc[0]
rank_data_03_25_2025.json CHANGED
@@ -179,7 +179,7 @@
179
  }
180
  ]
181
  },
182
- "Candy Crash": {
183
  "runs": 3,
184
  "results": [
185
  {
 
179
  }
180
  ]
181
  },
182
+ "Candy Crush": {
183
  "runs": 3,
184
  "results": [
185
  {