Spaces:
Sleeping
Sleeping
jarajpu
commited on
Commit
·
bf46a02
1
Parent(s):
c7d864c
adding leads
Browse files
app.py
CHANGED
|
@@ -289,19 +289,19 @@ def display_predictions():
|
|
| 289 |
def display_leaderboard():
|
| 290 |
if st.button("Show Leaderboard"):
|
| 291 |
try:
|
| 292 |
-
# Load the 'leaders' configuration
|
| 293 |
-
dataset = load_dataset("Jay-Rajput/DIS_IPL_Leads", split='train')
|
| 294 |
|
| 295 |
users_data = []
|
| 296 |
-
if dataset:
|
| 297 |
-
|
| 298 |
-
|
| 299 |
-
|
| 300 |
-
else:
|
| 301 |
-
|
| 302 |
-
|
| 303 |
-
|
| 304 |
-
|
| 305 |
|
| 306 |
leaderboard = pd.DataFrame(users_data)
|
| 307 |
|
|
|
|
| 289 |
def display_leaderboard():
|
| 290 |
if st.button("Show Leaderboard"):
|
| 291 |
try:
|
| 292 |
+
# # Load the 'leaders' configuration
|
| 293 |
+
# dataset = load_dataset("Jay-Rajput/DIS_IPL_Leads", split='train')
|
| 294 |
|
| 295 |
users_data = []
|
| 296 |
+
# if dataset:
|
| 297 |
+
# for user, points_dict in dataset[0].items():
|
| 298 |
+
# points = points_dict.get("points", 0)
|
| 299 |
+
# users_data.append({'User': user, 'Points': points})
|
| 300 |
+
# else:
|
| 301 |
+
data = load_users(USERS_JSON)
|
| 302 |
+
for user, points_dict in data.items():
|
| 303 |
+
points = points_dict.get("points", 0)
|
| 304 |
+
users_data.append({'User': user, 'Points': points})
|
| 305 |
|
| 306 |
leaderboard = pd.DataFrame(users_data)
|
| 307 |
|