Update app.py
Browse files
app.py
CHANGED
@@ -265,7 +265,6 @@ def restart_space():
|
|
265 |
try:
|
266 |
# Now restart the space
|
267 |
API.restart_space(repo_id=REPO_ID, token=HF_TOKEN)
|
268 |
-
preload_gt()
|
269 |
logging.info("Space restarted successfully.")
|
270 |
except Exception as e:
|
271 |
logging.error(f"Failed to restart space: {e}")
|
@@ -273,10 +272,7 @@ def restart_space():
|
|
273 |
|
274 |
# if __name__ == "__main__":
|
275 |
preload_gt()
|
276 |
-
# run_gradio()
|
277 |
-
|
278 |
scheduler = BackgroundScheduler()
|
279 |
-
scheduler.add_job(restart_space, "interval", hours=
|
280 |
-
logging.info("Scheduler initialized to restart space every 1 hour.")
|
281 |
scheduler.start()
|
282 |
interface.launch(show_error=True)
|
|
|
265 |
try:
|
266 |
# Now restart the space
|
267 |
API.restart_space(repo_id=REPO_ID, token=HF_TOKEN)
|
|
|
268 |
logging.info("Space restarted successfully.")
|
269 |
except Exception as e:
|
270 |
logging.error(f"Failed to restart space: {e}")
|
|
|
272 |
|
273 |
# if __name__ == "__main__":
|
274 |
preload_gt()
|
|
|
|
|
275 |
scheduler = BackgroundScheduler()
|
276 |
+
scheduler.add_job(restart_space, "interval", hours=5) # Restart every 5hs
|
|
|
277 |
scheduler.start()
|
278 |
interface.launch(show_error=True)
|