Spaces:
Running
Running
Oleg Shulyakov
commited on
Commit
·
629e9b9
1
Parent(s):
a35310e
Fix space restart
Browse files
app.py
CHANGED
@@ -13,6 +13,7 @@ from apscheduler.schedulers.background import BackgroundScheduler
|
|
13 |
|
14 |
|
15 |
# used for restarting the space
|
|
|
16 |
HF_TOKEN = os.environ.get("HF_TOKEN")
|
17 |
CONVERSION_SCRIPT = "./llama.cpp/convert_hf_to_gguf.py"
|
18 |
|
@@ -433,7 +434,7 @@ with gr.Blocks(css=css) as demo:
|
|
433 |
)
|
434 |
|
435 |
def restart_space():
|
436 |
-
HfApi().restart_space(repo_id=
|
437 |
|
438 |
scheduler = BackgroundScheduler()
|
439 |
scheduler.add_job(restart_space, "interval", seconds=21600)
|
|
|
13 |
|
14 |
|
15 |
# used for restarting the space
|
16 |
+
SPACE_ID = os.environ.get("SPACE_ID")
|
17 |
HF_TOKEN = os.environ.get("HF_TOKEN")
|
18 |
CONVERSION_SCRIPT = "./llama.cpp/convert_hf_to_gguf.py"
|
19 |
|
|
|
434 |
)
|
435 |
|
436 |
def restart_space():
|
437 |
+
HfApi().restart_space(repo_id=SPACE_ID, token=HF_TOKEN, factory_reboot=True)
|
438 |
|
439 |
scheduler = BackgroundScheduler()
|
440 |
scheduler.add_job(restart_space, "interval", seconds=21600)
|