Jay-Rajput commited on
Commit
84d098f
·
1 Parent(s): 95c6c66

adding dataset changes

Browse files
Files changed (2) hide show
  1. app.py +4 -7
  2. matches.json +1 -1
app.py CHANGED
@@ -33,7 +33,7 @@ scheduler = CommitScheduler(
33
  repo_type="dataset",
34
  folder_path=PREDICTIONS_FOLDER, # Local folder where predictions are saved temporarily
35
  path_in_repo="predictions", # Path in dataset repo where predictions will be saved
36
- every=5, # Push every 240 minutes (4 hours)
37
  )
38
 
39
  # Initialize CommitScheduler
@@ -42,7 +42,7 @@ scheduler = CommitScheduler(
42
  repo_type="dataset",
43
  folder_path=USERS_FOLDER, # Local folder where users are saved temporarily
44
  path_in_repo="leaders", # Path in dataset repo where predictions will be saved
45
- every=5, # Push every 240 minutes (4 hours)
46
  )
47
 
48
 
@@ -347,11 +347,8 @@ with st.expander("Leaderboard 🏆"):
347
  ############################# Admin Panel ##################################
348
  ADMIN_PASSPHRASE = "admin123"
349
 
350
- def load_dataset_repo():
351
- return load_dataset("Jay-Rajput/DIS_IPL_Dataset")
352
-
353
  def fetch_latest_predictions(match_id):
354
- dataset = load_dataset_repo()
355
  predictions = dataset['train'].filter(lambda example: example['match_id'] == match_id)
356
  return predictions
357
 
@@ -367,7 +364,7 @@ def update_leaderboard_and_outcomes(match_id, winning_team, man_of_the_match):
367
 
368
  outcomes = load_data(OUTCOMES_JSON) # Load existing match outcomes
369
  # Load existing match outcomes and user data from the test split
370
- dataset = load_dataset_repo()
371
  users = {item['user_name']: item for item in dataset['test']}
372
 
373
  # Directly update or add the match outcome
 
33
  repo_type="dataset",
34
  folder_path=PREDICTIONS_FOLDER, # Local folder where predictions are saved temporarily
35
  path_in_repo="predictions", # Path in dataset repo where predictions will be saved
36
+ every=10, # Push every 240 minutes (4 hours)
37
  )
38
 
39
  # Initialize CommitScheduler
 
42
  repo_type="dataset",
43
  folder_path=USERS_FOLDER, # Local folder where users are saved temporarily
44
  path_in_repo="leaders", # Path in dataset repo where predictions will be saved
45
+ every=10, # Push every 240 minutes (4 hours)
46
  )
47
 
48
 
 
347
  ############################# Admin Panel ##################################
348
  ADMIN_PASSPHRASE = "admin123"
349
 
 
 
 
350
  def fetch_latest_predictions(match_id):
351
+ dataset = load_dataset("Jay-Rajput/DIS_IPL_Dataset", config_name="predictions")
352
  predictions = dataset['train'].filter(lambda example: example['match_id'] == match_id)
353
  return predictions
354
 
 
364
 
365
  outcomes = load_data(OUTCOMES_JSON) # Load existing match outcomes
366
  # Load existing match outcomes and user data from the test split
367
+ dataset = load_dataset("Jay-Rajput/DIS_IPL_Dataset", config_name="leaders")
368
  users = {item['user_name']: item for item in dataset['test']}
369
 
370
  # Directly update or add the match outcome
matches.json CHANGED
@@ -36,7 +36,7 @@
36
  },
37
  {
38
  "match_id": "20240325_6",
39
- "date": "2024-03-25",
40
  "time": "7:30 PM",
41
  "teams": ["RCB", "PBKS"],
42
  "venue": "Bengaluru"
 
36
  },
37
  {
38
  "match_id": "20240325_6",
39
+ "date": "2024-03-26",
40
  "time": "7:30 PM",
41
  "teams": ["RCB", "PBKS"],
42
  "venue": "Bengaluru"