yoad commited on
Commit
d23bfff
·
verified ·
1 Parent(s): 324b4fe

Silence all dynamic stuff so the model will not restart after crashing

Browse files
Files changed (1) hide show
  1. app.py +20 -20
app.py CHANGED
@@ -16,24 +16,24 @@ from src.display.utils import AutoEvalColumn, fields, make_clickable_model
16
  from src.envs import API, EVAL_REQUESTS_PATH, EVAL_RESULTS_PATH, QUEUE_REPO, REPO_ID, RESULTS_REPO, TOKEN
17
 
18
 
19
- def restart_space():
20
- API.restart_space(repo_id=REPO_ID)
21
 
22
- ### Space initialisation
23
- try:
24
- print(EVAL_REQUESTS_PATH)
25
- snapshot_download(
26
- repo_id=QUEUE_REPO, local_dir=EVAL_REQUESTS_PATH, repo_type="dataset", tqdm_class=None, etag_timeout=30, token=TOKEN
27
- )
28
- except Exception:
29
- restart_space()
30
- try:
31
- print(EVAL_RESULTS_PATH)
32
- snapshot_download(
33
- repo_id=RESULTS_REPO, local_dir=EVAL_RESULTS_PATH, repo_type="dataset", tqdm_class=None, etag_timeout=30, token=TOKEN
34
- )
35
- except Exception:
36
- restart_space()
37
 
38
 
39
  MODEL_COLUMN_NAME = "model"
@@ -72,7 +72,7 @@ with demo:
72
  show_copy_button=True,
73
  )
74
 
75
- scheduler = BackgroundScheduler()
76
- scheduler.add_job(restart_space, "interval", seconds=1800)
77
- scheduler.start()
78
  demo.queue(default_concurrency_limit=40).launch()
 
16
  from src.envs import API, EVAL_REQUESTS_PATH, EVAL_RESULTS_PATH, QUEUE_REPO, REPO_ID, RESULTS_REPO, TOKEN
17
 
18
 
19
+ # def restart_space():
20
+ # API.restart_space(repo_id=REPO_ID)
21
 
22
+ # ### Space initialisation
23
+ # try:
24
+ # print(EVAL_REQUESTS_PATH)
25
+ # snapshot_download(
26
+ # repo_id=QUEUE_REPO, local_dir=EVAL_REQUESTS_PATH, repo_type="dataset", tqdm_class=None, etag_timeout=30, token=TOKEN
27
+ # )
28
+ # except Exception:
29
+ # restart_space()
30
+ # try:
31
+ # print(EVAL_RESULTS_PATH)
32
+ # snapshot_download(
33
+ # repo_id=RESULTS_REPO, local_dir=EVAL_RESULTS_PATH, repo_type="dataset", tqdm_class=None, etag_timeout=30, token=TOKEN
34
+ # )
35
+ # except Exception:
36
+ # restart_space()
37
 
38
 
39
  MODEL_COLUMN_NAME = "model"
 
72
  show_copy_button=True,
73
  )
74
 
75
+ # scheduler = BackgroundScheduler()
76
+ # scheduler.add_job(restart_space, "interval", seconds=1800)
77
+ # scheduler.start()
78
  demo.queue(default_concurrency_limit=40).launch()