Abhishek Thakur
commited on
Commit
·
f53f9d6
1
Parent(s):
0da9bfd
remove backend folder
Browse files- backend/__init__.py +0 -0
- backend/db/__init__.py +0 -0
- pages/2_📝_Leaderboard.py +18 -0
- pages/4_⭐️_Submission History.py +2 -4
backend/__init__.py
DELETED
File without changes
|
backend/db/__init__.py
DELETED
File without changes
|
pages/2_📝_Leaderboard.py
CHANGED
@@ -1,12 +1,30 @@
|
|
|
|
|
|
|
|
1 |
from datetime import datetime
|
2 |
|
3 |
import pandas as pd
|
4 |
import streamlit as st
|
|
|
5 |
|
6 |
import config
|
7 |
|
8 |
|
9 |
def fetch_leaderboard(private=False):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
data_dict = {
|
11 |
"Team Name": ["Team 1", "Team 2", "Team 3", "Team 4", "Team 5"],
|
12 |
"Score": [0.9, 0.8, 0.7, 0.6, 0.5],
|
|
|
1 |
+
import glob
|
2 |
+
import json
|
3 |
+
import os
|
4 |
from datetime import datetime
|
5 |
|
6 |
import pandas as pd
|
7 |
import streamlit as st
|
8 |
+
from huggingface_hub import snapshot_download
|
9 |
|
10 |
import config
|
11 |
|
12 |
|
13 |
def fetch_leaderboard(private=False):
|
14 |
+
submissions_folder = snapshot_download(
|
15 |
+
repo_id=config.COMPETITION_ID,
|
16 |
+
allow_patterns="*.json",
|
17 |
+
use_auth_token=config.AUTOTRAIN_TOKEN,
|
18 |
+
repo_type="dataset",
|
19 |
+
)
|
20 |
+
submissions = []
|
21 |
+
for submission in glob.glob(os.path.join(submissions_folder, "*.json")):
|
22 |
+
with open(submission, "r") as f:
|
23 |
+
submission_info = json.load(f)
|
24 |
+
submissions.append(submission_info)
|
25 |
+
|
26 |
+
print(submissions)
|
27 |
+
|
28 |
data_dict = {
|
29 |
"Team Name": ["Team 1", "Team 2", "Team 3", "Team 4", "Team 5"],
|
30 |
"Score": [0.9, 0.8, 0.7, 0.6, 0.5],
|
pages/4_⭐️_Submission History.py
CHANGED
@@ -7,8 +7,7 @@ from huggingface_hub.utils._errors import EntryNotFoundError
|
|
7 |
import config
|
8 |
import utils
|
9 |
|
10 |
-
SUBMISSION_TEXT = """You can select upto
|
11 |
-
"""
|
12 |
|
13 |
|
14 |
def get_subs(user_info, private=False):
|
@@ -53,8 +52,7 @@ def app():
|
|
53 |
private = False
|
54 |
if current_date_time >= config.END_DATE:
|
55 |
private = True
|
56 |
-
|
57 |
-
get_subs(user_info, private=private)
|
58 |
|
59 |
|
60 |
if __name__ == "__main__":
|
|
|
7 |
import config
|
8 |
import utils
|
9 |
|
10 |
+
SUBMISSION_TEXT = f"""You can select upto {config.SELECTION_LIMIT} submissions for private leaderboard."""
|
|
|
11 |
|
12 |
|
13 |
def get_subs(user_info, private=False):
|
|
|
52 |
private = False
|
53 |
if current_date_time >= config.END_DATE:
|
54 |
private = True
|
55 |
+
get_subs(user_info, private=private)
|
|
|
56 |
|
57 |
|
58 |
if __name__ == "__main__":
|