Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Update app.py
Browse files
app.py
CHANGED
@@ -8,6 +8,8 @@ from huggingface_hub import HfApi, Repository
|
|
8 |
|
9 |
from onnx_export import convert
|
10 |
|
|
|
|
|
11 |
DATASET_REPO_URL = "https://huggingface.co/datasets/optimum/exporters"
|
12 |
DATA_FILENAME = "data.csv"
|
13 |
DATA_FILE = os.path.join("data", DATA_FILENAME)
|
@@ -151,4 +153,11 @@ with gr.Blocks() as demo:
|
|
151 |
outputs=output,
|
152 |
)
|
153 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
154 |
demo.launch()
|
|
|
8 |
|
9 |
from onnx_export import convert
|
10 |
|
11 |
+
from apscheduler.schedulers.background import BackgroundScheduler
|
12 |
+
|
13 |
DATASET_REPO_URL = "https://huggingface.co/datasets/optimum/exporters"
|
14 |
DATA_FILENAME = "data.csv"
|
15 |
DATA_FILE = os.path.join("data", DATA_FILENAME)
|
|
|
153 |
outputs=output,
|
154 |
)
|
155 |
|
156 |
+
def restart_space():
|
157 |
+
HfApi().restart_space(repo_id="onnx/export", token=HF_TOKEN, factory_reboot=True)
|
158 |
+
|
159 |
+
scheduler = BackgroundScheduler()
|
160 |
+
scheduler.add_job(restart_space, "interval", seconds=21600)
|
161 |
+
scheduler.start()
|
162 |
+
|
163 |
demo.launch()
|