TejAndrewsACC commited on
Commit
bb3ef29
·
verified ·
1 Parent(s): 1a11488

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -0
app.py CHANGED
@@ -1,3 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  import gradio as gr
2
  from gradio_client import Client
3
  import torch
 
1
+ import os
2
+ import sys
3
+ import threading
4
+
5
+ def restart_app():
6
+ print("Restarting...")
7
+ os.execv(sys.executable, ['python'] + sys.argv)
8
+
9
+ def schedule_restart():
10
+ threading.Timer(3600, restart_app).start()
11
+
12
+ schedule_restart()
13
+
14
  import gradio as gr
15
  from gradio_client import Client
16
  import torch