Abhishek Thakur
commited on
Commit
·
444518c
1
Parent(s):
48a5e54
fix duplicate columns
Browse files- competitions/leaderboard.py +5 -0
- requirements.txt +2 -2
competitions/leaderboard.py
CHANGED
@@ -67,6 +67,7 @@ class Leaderboard:
|
|
67 |
# get the first key after sorting
|
68 |
score_key = sorted(score_keys)[0]
|
69 |
other_scores = [f"public_score_{k}" for k in score_keys if k != score_key]
|
|
|
70 |
self.public_columns.extend(other_scores)
|
71 |
for _sub in submission_info["submissions"]:
|
72 |
for skey in score_keys:
|
@@ -252,6 +253,10 @@ class Leaderboard:
|
|
252 |
logger.info(df)
|
253 |
columns = self.public_columns if not private else self.private_columns
|
254 |
logger.info(columns)
|
|
|
|
|
|
|
|
|
255 |
# send submission_datetime to the end
|
256 |
columns.remove("submission_datetime")
|
257 |
columns.append("submission_datetime")
|
|
|
67 |
# get the first key after sorting
|
68 |
score_key = sorted(score_keys)[0]
|
69 |
other_scores = [f"public_score_{k}" for k in score_keys if k != score_key]
|
70 |
+
|
71 |
self.public_columns.extend(other_scores)
|
72 |
for _sub in submission_info["submissions"]:
|
73 |
for skey in score_keys:
|
|
|
253 |
logger.info(df)
|
254 |
columns = self.public_columns if not private else self.private_columns
|
255 |
logger.info(columns)
|
256 |
+
# remove duplicate columns
|
257 |
+
# ['rank', 'name', 'public_score', 'submission_datetime', 'public_score_track1', 'public_score_track1', 'public_score_track1', 'public_score_track1']
|
258 |
+
columns = list(dict.fromkeys(columns))
|
259 |
+
|
260 |
# send submission_datetime to the end
|
261 |
columns.remove("submission_datetime")
|
262 |
columns.append("submission_datetime")
|
requirements.txt
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
gradio==3.10.1
|
2 |
joblib==1.2.0
|
3 |
-
loguru
|
4 |
-
pandas
|
5 |
huggingface_hub>=0.10.1
|
6 |
tabulate==0.9.0
|
|
|
1 |
gradio==3.10.1
|
2 |
joblib==1.2.0
|
3 |
+
loguru>=0.6.0
|
4 |
+
pandas>=1.5.0
|
5 |
huggingface_hub>=0.10.1
|
6 |
tabulate==0.9.0
|