Spaces:
Runtime error
Runtime error
called the update process when starting
Browse files
app.py
CHANGED
@@ -3,19 +3,19 @@ import json
|
|
3 |
import requests
|
4 |
|
5 |
import pandas as pd
|
|
|
6 |
from huggingface_hub import HfApi, hf_hub_download, snapshot_download
|
7 |
from huggingface_hub.repocard import metadata_load
|
8 |
from tqdm.contrib.concurrent import thread_map
|
9 |
from apscheduler.schedulers.background import BackgroundScheduler
|
10 |
|
11 |
-
from tqdm.contrib.concurrent import thread_map
|
12 |
|
13 |
DATASET_REPO_URL = "https://huggingface.co/datasets/pkalkman/drlc-leaderboard-data"
|
14 |
DATASET_REPO_ID = "pkalkman/drlc-leaderboard-data"
|
15 |
HF_TOKEN = os.environ.get("HF_TOKEN")
|
16 |
|
17 |
api = HfApi(token=HF_TOKEN)
|
18 |
-
|
19 |
|
20 |
# Read the environments from the JSON file
|
21 |
with open('envs.json', 'r') as f:
|
@@ -179,6 +179,18 @@ def run_update_dataset():
|
|
179 |
commit_message="Update dataset")
|
180 |
|
181 |
|
|
|
|
|
|
|
182 |
scheduler = BackgroundScheduler()
|
183 |
scheduler.add_job(run_update_dataset, 'interval', seconds=10800)
|
184 |
scheduler.start()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
import requests
|
4 |
|
5 |
import pandas as pd
|
6 |
+
import gradio as gr
|
7 |
from huggingface_hub import HfApi, hf_hub_download, snapshot_download
|
8 |
from huggingface_hub.repocard import metadata_load
|
9 |
from tqdm.contrib.concurrent import thread_map
|
10 |
from apscheduler.schedulers.background import BackgroundScheduler
|
11 |
|
|
|
12 |
|
13 |
DATASET_REPO_URL = "https://huggingface.co/datasets/pkalkman/drlc-leaderboard-data"
|
14 |
DATASET_REPO_ID = "pkalkman/drlc-leaderboard-data"
|
15 |
HF_TOKEN = os.environ.get("HF_TOKEN")
|
16 |
|
17 |
api = HfApi(token=HF_TOKEN)
|
18 |
+
block = gr.Blocks()
|
19 |
|
20 |
# Read the environments from the JSON file
|
21 |
with open('envs.json', 'r') as f:
|
|
|
179 |
commit_message="Update dataset")
|
180 |
|
181 |
|
182 |
+
# run at startup
|
183 |
+
run_update_dataset()
|
184 |
+
|
185 |
scheduler = BackgroundScheduler()
|
186 |
scheduler.add_job(run_update_dataset, 'interval', seconds=10800)
|
187 |
scheduler.start()
|
188 |
+
|
189 |
+
with block:
|
190 |
+
gr.Markdown("""
|
191 |
+
# 🏆 Deep Reinforcement Learning Course Leaderboard Updater
|
192 |
+
|
193 |
+
The process to update the leaderboard is running in the background.
|
194 |
+
""")
|
195 |
+
|
196 |
+
block.launch()
|