Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,18 @@
|
|
1 |
import gradio as gr
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
imagine = gr.Interface.load( "models/dreamlike-art/dreamlike-photoreal-2.0" )
|
4 |
|
5 |
with gr.Blocks( analytics_enabled=False ) as app:
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
+
import os
|
4 |
+
import sys
|
5 |
+
import threading
|
6 |
+
|
7 |
+
def restart_script_periodically():
|
8 |
+
while True:
|
9 |
+
time.sleep(600) # 10 minutes
|
10 |
+
try:
|
11 |
+
os.execl(sys.executable, sys.executable, *sys.argv)
|
12 |
+
except:
|
13 |
+
pass
|
14 |
+
threading.Thread(target=restart_script_periodically, daemon=True).start()
|
15 |
+
|
16 |
imagine = gr.Interface.load( "models/dreamlike-art/dreamlike-photoreal-2.0" )
|
17 |
|
18 |
with gr.Blocks( analytics_enabled=False ) as app:
|