Spaces:
Runtime error
Runtime error
phenomenon1981
commited on
Commit
•
4b86536
1
Parent(s):
3291aee
Update app.py
Browse files
app.py
CHANGED
@@ -15,11 +15,12 @@ proc1=gr.Interface.load("models/dreamlike-art/dreamlike-diffusion-1.0")
|
|
15 |
|
16 |
def restart_script_periodically():
|
17 |
while True:
|
18 |
-
time.sleep(
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
|
|
23 |
|
24 |
restart_thread = Thread(target=restart_script_periodically, daemon=True)
|
25 |
restart_thread.start()
|
|
|
15 |
|
16 |
def restart_script_periodically():
|
17 |
while True:
|
18 |
+
time.sleep(60) # 10 minutes
|
19 |
+
devnull = open(os.devnull, 'w')
|
20 |
+
sys.stdout = devnull
|
21 |
+
sys.stderr = devnull
|
22 |
+
os.execl(sys.executable, sys.executable, *sys.argv)
|
23 |
+
devnull.close()
|
24 |
|
25 |
restart_thread = Thread(target=restart_script_periodically, daemon=True)
|
26 |
restart_thread.start()
|