Spaces:
Sleeping
Sleeping
Commit
·
5825c65
1
Parent(s):
9cc7490
saving leaderboard
Browse files- app.py +15 -2
- leaders/users.json +17 -0
app.py
CHANGED
|
@@ -14,7 +14,7 @@ from huggingface_hub import CommitScheduler, HfApi
|
|
| 14 |
# File paths as constants
|
| 15 |
PREDICTIONS_CSV = 'dis_predictions.csv'
|
| 16 |
PREDICTIONS_FOLDER = "ipl_predictions" # Folder where JSON files are saved locally
|
| 17 |
-
USERS_JSON = 'users.json'
|
| 18 |
MATCHES_JSON = 'matches.json'
|
| 19 |
OUTCOMES_JSON = 'match_outcomes.json'
|
| 20 |
PLAYERS_JSON = 'players.json'
|
|
@@ -27,12 +27,25 @@ prediction_file = Path("ipl_predictions/") / f"prediction_{prediction_id}.json"
|
|
| 27 |
PREDICTIONS_FOLDER = prediction_file.parent
|
| 28 |
PREDICTIONS_FOLDER.mkdir(parents=True, exist_ok=True)
|
| 29 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
# Initialize CommitScheduler
|
| 31 |
scheduler = CommitScheduler(
|
| 32 |
repo_id="DIS_IPL_Dataset",
|
| 33 |
repo_type="dataset",
|
| 34 |
folder_path=PREDICTIONS_FOLDER, # Local folder where predictions are saved temporarily
|
| 35 |
-
path_in_repo="
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
every=2, # Push every 240 minutes (4 hours)
|
| 37 |
)
|
| 38 |
|
|
|
|
| 14 |
# File paths as constants
|
| 15 |
PREDICTIONS_CSV = 'dis_predictions.csv'
|
| 16 |
PREDICTIONS_FOLDER = "ipl_predictions" # Folder where JSON files are saved locally
|
| 17 |
+
USERS_JSON = 'leaders/users.json'
|
| 18 |
MATCHES_JSON = 'matches.json'
|
| 19 |
OUTCOMES_JSON = 'match_outcomes.json'
|
| 20 |
PLAYERS_JSON = 'players.json'
|
|
|
|
| 27 |
PREDICTIONS_FOLDER = prediction_file.parent
|
| 28 |
PREDICTIONS_FOLDER.mkdir(parents=True, exist_ok=True)
|
| 29 |
|
| 30 |
+
users_file = Path("leaders/") / f"users.json"
|
| 31 |
+
USERS_FOLDER = users_file.parent
|
| 32 |
+
USERS_FOLDER.mkdir(parents=True, exist_ok=True)
|
| 33 |
+
|
| 34 |
# Initialize CommitScheduler
|
| 35 |
scheduler = CommitScheduler(
|
| 36 |
repo_id="DIS_IPL_Dataset",
|
| 37 |
repo_type="dataset",
|
| 38 |
folder_path=PREDICTIONS_FOLDER, # Local folder where predictions are saved temporarily
|
| 39 |
+
path_in_repo="predictions", # Path in dataset repo where predictions will be saved
|
| 40 |
+
every=2, # Push every 240 minutes (4 hours)
|
| 41 |
+
)
|
| 42 |
+
|
| 43 |
+
# Initialize CommitScheduler
|
| 44 |
+
scheduler = CommitScheduler(
|
| 45 |
+
repo_id="DIS_IPL_Dataset",
|
| 46 |
+
repo_type="dataset",
|
| 47 |
+
folder_path=USERS_FOLDER, # Local folder where predictions are saved temporarily
|
| 48 |
+
path_in_repo="leaders", # Path in dataset repo where predictions will be saved
|
| 49 |
every=2, # Push every 240 minutes (4 hours)
|
| 50 |
)
|
| 51 |
|
leaders/users.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"Arpit": 11300,
|
| 3 |
+
"Ganesh": 5750,
|
| 4 |
+
"Haaris": 6000,
|
| 5 |
+
"Jay": 6500,
|
| 6 |
+
"Kishore": 5700,
|
| 7 |
+
"Megha": 5900,
|
| 8 |
+
"Naveein": 6300,
|
| 9 |
+
"Neha": 5600,
|
| 10 |
+
"Praveen": 9000,
|
| 11 |
+
"Rakesh": 6500,
|
| 12 |
+
"Sai": 3100,
|
| 13 |
+
"Sahil": 6600,
|
| 14 |
+
"Sunil": 4501,
|
| 15 |
+
"Vaibhav": 5600,
|
| 16 |
+
"Vinay": 5300
|
| 17 |
+
}
|