Abhishek Thakur
commited on
Commit
·
53a304d
1
Parent(s):
0ec6e70
disable private lb
Browse files- competitions/app.py +5 -4
competitions/app.py
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
import os
|
2 |
import threading
|
3 |
|
@@ -122,10 +123,10 @@ async def get_leaderboard(request: Request, lb: str):
|
|
122 |
token=HF_TOKEN,
|
123 |
scoring_metric=COMP_INFO.scoring_metric,
|
124 |
)
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
df = leaderboard.fetch(private=lb == "private")
|
130 |
logger.info(df)
|
131 |
if len(df) == 0:
|
|
|
1 |
+
import datetime
|
2 |
import os
|
3 |
import threading
|
4 |
|
|
|
123 |
token=HF_TOKEN,
|
124 |
scoring_metric=COMP_INFO.scoring_metric,
|
125 |
)
|
126 |
+
if lb == "private":
|
127 |
+
current_utc_time = datetime.datetime.utcnow()
|
128 |
+
if current_utc_time < COMP_INFO.end_date:
|
129 |
+
return {"response": "Private leaderboard will be available after the competition ends."}
|
130 |
df = leaderboard.fetch(private=lb == "private")
|
131 |
logger.info(df)
|
132 |
if len(df) == 0:
|