Spaces:
Running
Running
Upload app.py
Browse files
app.py
CHANGED
@@ -72,7 +72,7 @@ from game_reasoning_arena.backends import (
|
|
72 |
)
|
73 |
|
74 |
# UI utilities
|
75 |
-
from ui.utils import clean_model_name
|
76 |
|
77 |
# =============================================================================
|
78 |
# GLOBAL CONFIGURATION
|
@@ -140,6 +140,28 @@ try:
|
|
140 |
log.info(
|
141 |
"Available games in registry: %s", list(GAMES_REGISTRY.keys())
|
142 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
143 |
else:
|
144 |
GAMES_REGISTRY = {}
|
145 |
log.warning("games_registry is None - using fallback games")
|
@@ -148,6 +170,36 @@ except Exception as e:
|
|
148 |
GAMES_REGISTRY = {}
|
149 |
|
150 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
151 |
def _get_game_display_mapping() -> Dict[str, str]:
|
152 |
"""
|
153 |
Build a mapping from internal game keys to their human-friendly
|
@@ -1177,13 +1229,13 @@ with gr.Blocks() as interface:
|
|
1177 |
)
|
1178 |
# Use the same display logic as Game Arena
|
1179 |
leaderboard_config = create_player_config(include_aggregated=True)
|
1180 |
-
|
1181 |
# Debug: Log the available games for troubleshooting
|
1182 |
log.info(
|
1183 |
"Leaderboard available games: %s",
|
1184 |
leaderboard_config["available_games"]
|
1185 |
)
|
1186 |
-
|
1187 |
leaderboard_game_dropdown = gr.Dropdown(
|
1188 |
choices=leaderboard_config["available_games"],
|
1189 |
label="Select Game",
|
|
|
72 |
)
|
73 |
|
74 |
# UI utilities
|
75 |
+
from ui.utils import clean_model_name, get_games_from_databases
|
76 |
|
77 |
# =============================================================================
|
78 |
# GLOBAL CONFIGURATION
|
|
|
140 |
log.info(
|
141 |
"Available games in registry: %s", list(GAMES_REGISTRY.keys())
|
142 |
)
|
143 |
+
|
144 |
+
# Debug: Check if hex is specifically missing and why
|
145 |
+
if "hex" not in GAMES_REGISTRY:
|
146 |
+
log.warning("HEX GAME NOT FOUND! Investigating...")
|
147 |
+
try:
|
148 |
+
# Try to manually import hex components
|
149 |
+
from game_reasoning_arena.arena.envs.hex_env import ( # noqa: F401
|
150 |
+
HexEnv
|
151 |
+
)
|
152 |
+
log.info("β
HexEnv import successful")
|
153 |
+
except Exception as hex_env_error:
|
154 |
+
log.error("β HexEnv import failed: %s", hex_env_error)
|
155 |
+
|
156 |
+
try:
|
157 |
+
import pyspiel
|
158 |
+
test_hex = pyspiel.load_game("hex")
|
159 |
+
log.info("β
PySpiel hex game load successful")
|
160 |
+
except Exception as pyspiel_error:
|
161 |
+
log.error("β PySpiel hex game load failed: %s", pyspiel_error)
|
162 |
+
else:
|
163 |
+
log.info("β
Hex game found in registry")
|
164 |
+
|
165 |
else:
|
166 |
GAMES_REGISTRY = {}
|
167 |
log.warning("games_registry is None - using fallback games")
|
|
|
170 |
GAMES_REGISTRY = {}
|
171 |
|
172 |
|
173 |
+
# Debug: Log games available in database files
|
174 |
+
try:
|
175 |
+
db_games = get_games_from_databases()
|
176 |
+
log.info("Games found in database files: %s", sorted(list(db_games)))
|
177 |
+
|
178 |
+
if "hex" in db_games:
|
179 |
+
log.info("β
Hex data found in databases")
|
180 |
+
else:
|
181 |
+
log.warning("β No hex data found in databases")
|
182 |
+
|
183 |
+
# Check for registry vs database mismatch
|
184 |
+
registry_games = set(GAMES_REGISTRY.keys())
|
185 |
+
missing_in_registry = db_games - registry_games
|
186 |
+
missing_in_db = registry_games - db_games
|
187 |
+
|
188 |
+
if missing_in_registry:
|
189 |
+
log.warning(
|
190 |
+
"Games in DB but missing from registry: %s",
|
191 |
+
sorted(list(missing_in_registry))
|
192 |
+
)
|
193 |
+
if missing_in_db:
|
194 |
+
log.info(
|
195 |
+
"Games in registry but missing from DB: %s",
|
196 |
+
sorted(list(missing_in_db))
|
197 |
+
)
|
198 |
+
|
199 |
+
except Exception as e:
|
200 |
+
log.error("Error checking database games: %s", e)
|
201 |
+
|
202 |
+
|
203 |
def _get_game_display_mapping() -> Dict[str, str]:
|
204 |
"""
|
205 |
Build a mapping from internal game keys to their human-friendly
|
|
|
1229 |
)
|
1230 |
# Use the same display logic as Game Arena
|
1231 |
leaderboard_config = create_player_config(include_aggregated=True)
|
1232 |
+
|
1233 |
# Debug: Log the available games for troubleshooting
|
1234 |
log.info(
|
1235 |
"Leaderboard available games: %s",
|
1236 |
leaderboard_config["available_games"]
|
1237 |
)
|
1238 |
+
|
1239 |
leaderboard_game_dropdown = gr.Dropdown(
|
1240 |
choices=leaderboard_config["available_games"],
|
1241 |
label="Select Game",
|