Spaces:
Runtime error
Runtime error
lixuejing
commited on
Commit
Β·
42e2f96
1
Parent(s):
a8d737a
fix init_space bug
Browse files
app.py
CHANGED
@@ -38,21 +38,23 @@ from src.tools.plots import (
|
|
38 |
def restart_space():
|
39 |
API.restart_space(repo_id=REPO_ID)
|
40 |
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
|
|
|
|
56 |
|
57 |
#raw_data, original_df = get_leaderboard_df(
|
58 |
leaderboard_df = get_leaderboard_df(
|
|
|
38 |
def restart_space():
|
39 |
API.restart_space(repo_id=REPO_ID)
|
40 |
|
41 |
+
|
42 |
+
def init_space():
|
43 |
+
### Space initialisation
|
44 |
+
try:
|
45 |
+
print(EVAL_REQUESTS_PATH)
|
46 |
+
snapshot_download(
|
47 |
+
repo_id=QUEUE_REPO, local_dir=EVAL_REQUESTS_PATH, repo_type="dataset", tqdm_class=None, etag_timeout=30, token=TOKEN
|
48 |
+
)
|
49 |
+
except Exception:
|
50 |
+
restart_space()
|
51 |
+
try:
|
52 |
+
print(EVAL_RESULTS_PATH)
|
53 |
+
snapshot_download(
|
54 |
+
repo_id=RESULTS_REPO, local_dir=EVAL_RESULTS_PATH, repo_type="dataset", tqdm_class=None, etag_timeout=30, token=TOKEN
|
55 |
+
)
|
56 |
+
except Exception:
|
57 |
+
restart_space()
|
58 |
|
59 |
#raw_data, original_df = get_leaderboard_df(
|
60 |
leaderboard_df = get_leaderboard_df(
|