jin-nin commited on
Commit
5c9d8a2
1 Parent(s): 91ba95c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -0
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: