idolezal commited on
Commit
934ac05
ยท
1 Parent(s): 517ba24

Uppercase name of constant variables

Browse files
Files changed (1) hide show
  1. server.py +10 -10
server.py CHANGED
@@ -147,11 +147,11 @@ class ReadWriteLock:
147
 
148
  class LeaderboardServer:
149
  def __init__(self):
150
- self.server_address = REPO
151
- self.repo_type = "dataset"
152
  self.local_leaderboard = snapshot_download(
153
- self.server_address,
154
- repo_type=self.repo_type,
155
  token=HF_TOKEN,
156
  local_dir="./",
157
  )
@@ -175,8 +175,8 @@ class LeaderboardServer:
175
 
176
  def update_leaderboard(self):
177
  self.local_leaderboard = snapshot_download(
178
- self.server_address,
179
- repo_type=self.repo_type,
180
  token=HF_TOKEN,
181
  local_dir="./",
182
  )
@@ -616,8 +616,8 @@ class LeaderboardServer:
616
  api.upload_file(
617
  path_or_fileobj=file,
618
  path_in_repo=f"data/{submission_id}.json",
619
- repo_id=self.server_address,
620
- repo_type=self.repo_type,
621
  token=HF_TOKEN,
622
  )
623
 
@@ -630,8 +630,8 @@ class LeaderboardServer:
630
  api.upload_file(
631
  path_or_fileobj=tournament_results_path,
632
  path_in_repo="tournament.json",
633
- repo_id=self.server_address,
634
- repo_type=self.repo_type,
635
  token=HF_TOKEN,
636
  )
637
 
 
147
 
148
  class LeaderboardServer:
149
  def __init__(self):
150
+ self.SERVER_ADDRESS = REPO
151
+ self.REPO_TYPE = "dataset"
152
  self.local_leaderboard = snapshot_download(
153
+ self.SERVER_ADDRESS,
154
+ repo_type=self.REPO_TYPE,
155
  token=HF_TOKEN,
156
  local_dir="./",
157
  )
 
175
 
176
  def update_leaderboard(self):
177
  self.local_leaderboard = snapshot_download(
178
+ self.SERVER_ADDRESS,
179
+ repo_type=self.REPO_TYPE,
180
  token=HF_TOKEN,
181
  local_dir="./",
182
  )
 
616
  api.upload_file(
617
  path_or_fileobj=file,
618
  path_in_repo=f"data/{submission_id}.json",
619
+ repo_id=self.SERVER_ADDRESS,
620
+ repo_type=self.REPO_TYPE,
621
  token=HF_TOKEN,
622
  )
623
 
 
630
  api.upload_file(
631
  path_or_fileobj=tournament_results_path,
632
  path_in_repo="tournament.json",
633
+ repo_id=self.SERVER_ADDRESS,
634
+ repo_type=self.REPO_TYPE,
635
  token=HF_TOKEN,
636
  )
637