alozowski commited on
Commit
93c865a
1 Parent(s): 82b29b7

Disable cache

Browse files
Files changed (1) hide show
  1. app.py +7 -10
app.py CHANGED
@@ -1,4 +1,3 @@
1
- import os
2
  import logging
3
  import time
4
  import schedule
@@ -100,29 +99,27 @@ def download_dataset(repo_id, local_dir, repo_type="dataset", max_attempts=3, ba
100
  attempt += 1
101
  raise Exception(f"Failed to download {repo_id} after {max_attempts} attempts")
102
 
103
- def get_latest_data_leaderboard(leaderboard_initial_df = None):
104
  global NEW_DATA_ON_LEADERBOARD
105
  global LEADERBOARD_DF
106
  if NEW_DATA_ON_LEADERBOARD:
107
  print("Leaderboard updated at reload!")
108
  leaderboard_dataset = datasets.load_dataset(
109
- AGGREGATED_REPO,
110
- "default",
111
- split="train",
112
- cache_dir=HF_HOME,
113
- download_mode=datasets.DownloadMode.REUSE_DATASET_IF_EXISTS, # Uses the cached dataset
114
  verification_mode="no_checks"
115
  )
116
  LEADERBOARD_DF = get_leaderboard_df(
117
- leaderboard_dataset=leaderboard_dataset,
118
  cols=COLS,
119
  benchmark_cols=BENCHMARK_COLS,
120
  )
121
  NEW_DATA_ON_LEADERBOARD = False
122
-
123
  else:
124
  LEADERBOARD_DF = leaderboard_initial_df
125
-
126
  return LEADERBOARD_DF
127
 
128
 
 
 
1
  import logging
2
  import time
3
  import schedule
 
99
  attempt += 1
100
  raise Exception(f"Failed to download {repo_id} after {max_attempts} attempts")
101
 
102
+ def get_latest_data_leaderboard(leaderboard_initial_df=None):
103
  global NEW_DATA_ON_LEADERBOARD
104
  global LEADERBOARD_DF
105
  if NEW_DATA_ON_LEADERBOARD:
106
  print("Leaderboard updated at reload!")
107
  leaderboard_dataset = datasets.load_dataset(
108
+ AGGREGATED_REPO,
109
+ "default",
110
+ split="train",
111
+ cache_dir=None, # Disable cache directory usage
112
+ download_mode=datasets.DownloadMode.FORCE_REDOWNLOAD, # Always download fresh data
113
  verification_mode="no_checks"
114
  )
115
  LEADERBOARD_DF = get_leaderboard_df(
116
+ leaderboard_dataset=leaderboard_dataset,
117
  cols=COLS,
118
  benchmark_cols=BENCHMARK_COLS,
119
  )
120
  NEW_DATA_ON_LEADERBOARD = False
 
121
  else:
122
  LEADERBOARD_DF = leaderboard_initial_df
 
123
  return LEADERBOARD_DF
124
 
125