Spaces:
Runtime error
Runtime error
Commit
·
697c25c
1
Parent(s):
fd468ce
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from huggingface_hub import HfApi, hf_hub_download, snapshot_download
|
2 |
+
from apscheduler.schedulers.background import BackgroundScheduler
|
3 |
+
|
4 |
+
HF_TOKEN = os.environ.get("HF_TOKEN")
|
5 |
+
|
6 |
+
api = HfApi(token=HF_TOKEN)
|
7 |
+
|
8 |
+
def restart():
|
9 |
+
api.restart_space(repo_id="huggingface-projects/Deep-Reinforcement-Learning-Leaderboard")
|
10 |
+
|
11 |
+
scheduler = BackgroundScheduler()
|
12 |
+
# Refresh every hour
|
13 |
+
scheduler.add_job(restart, 'interval', seconds=3600)
|
14 |
+
scheduler.start()
|
15 |
+
|