Spaces:
Running
Running
Uppercase name of constant variables
Browse files
server.py
CHANGED
|
@@ -147,11 +147,11 @@ class ReadWriteLock:
|
|
| 147 |
|
| 148 |
class LeaderboardServer:
|
| 149 |
def __init__(self):
|
| 150 |
-
self.
|
| 151 |
-
self.
|
| 152 |
self.local_leaderboard = snapshot_download(
|
| 153 |
-
self.
|
| 154 |
-
repo_type=self.
|
| 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.
|
| 179 |
-
repo_type=self.
|
| 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.
|
| 620 |
-
repo_type=self.
|
| 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.
|
| 634 |
-
repo_type=self.
|
| 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 |
|