Eran Fainman
commited on
Commit
·
254099a
1
Parent(s):
ac48997
Add application file
Browse files
app.py
CHANGED
@@ -16,16 +16,18 @@ EVAL_RESULTS_PATH = os.path.join(CACHE_PATH, "eval-results")
|
|
16 |
|
17 |
API = hh.HfApi(token=TOKEN)
|
18 |
|
|
|
19 |
def restart_space():
|
20 |
API.restart_space(repo_id=REPO_ID)
|
21 |
|
|
|
22 |
try:
|
23 |
hh.snapshot_download(
|
24 |
repo_id=RESULTS_REPO, local_dir=EVAL_RESULTS_PATH, repo_type=None, tqdm_class=None, etag_timeout=30,
|
25 |
token=TOKEN
|
26 |
)
|
27 |
-
except:
|
28 |
-
|
29 |
|
30 |
df_results = pd.read_csv(os.path.join(EVAL_RESULTS_PATH, 'results.csv'))
|
31 |
st.table(df_results)
|
|
|
16 |
|
17 |
API = hh.HfApi(token=TOKEN)
|
18 |
|
19 |
+
|
20 |
def restart_space():
|
21 |
API.restart_space(repo_id=REPO_ID)
|
22 |
|
23 |
+
|
24 |
try:
|
25 |
hh.snapshot_download(
|
26 |
repo_id=RESULTS_REPO, local_dir=EVAL_RESULTS_PATH, repo_type=None, tqdm_class=None, etag_timeout=30,
|
27 |
token=TOKEN
|
28 |
)
|
29 |
+
except Exception:
|
30 |
+
restart_space()
|
31 |
|
32 |
df_results = pd.read_csv(os.path.join(EVAL_RESULTS_PATH, 'results.csv'))
|
33 |
st.table(df_results)
|