Spaces:
Runtime error
Runtime error
phenomenon1981
commited on
Commit
·
2091418
1
Parent(s):
cadc7e6
Update app.py
Browse files
app.py
CHANGED
@@ -9,7 +9,7 @@ from queue import Queue
|
|
9 |
from threading import Thread
|
10 |
|
11 |
queue = Queue()
|
12 |
-
queue_threshold =
|
13 |
|
14 |
text_gen=gr.Interface.load("spaces/Omnibus/MagicPrompt-Stable-Diffusion")
|
15 |
proc1=gr.Interface.load("models/dreamlike-art/dreamlike-photoreal-2.0", live=True)
|
@@ -17,7 +17,7 @@ proc1=gr.Interface.load("models/dreamlike-art/dreamlike-photoreal-2.0", live=Tru
|
|
17 |
def reset_queue_periodically():
|
18 |
start_time = time.time()
|
19 |
while True:
|
20 |
-
if time.time() - start_time >=
|
21 |
queue.queue.clear()
|
22 |
start_time = time.time()
|
23 |
|
@@ -154,7 +154,7 @@ myface.launch(enable_queue=True, inline=True)
|
|
154 |
block.queue(concurrency_count=30, max_size=90).launch(max_threads=100)
|
155 |
def restart_script_periodically():
|
156 |
while True:
|
157 |
-
time.sleep(
|
158 |
os.execl(sys.executable, sys.executable, *sys.argv)
|
159 |
|
160 |
restart_thread = Thread(target=restart_script_periodically, daemon=True)
|
|
|
9 |
from threading import Thread
|
10 |
|
11 |
queue = Queue()
|
12 |
+
queue_threshold = 30
|
13 |
|
14 |
text_gen=gr.Interface.load("spaces/Omnibus/MagicPrompt-Stable-Diffusion")
|
15 |
proc1=gr.Interface.load("models/dreamlike-art/dreamlike-photoreal-2.0", live=True)
|
|
|
17 |
def reset_queue_periodically():
|
18 |
start_time = time.time()
|
19 |
while True:
|
20 |
+
if time.time() - start_time >= 300: # 5 minutes
|
21 |
queue.queue.clear()
|
22 |
start_time = time.time()
|
23 |
|
|
|
154 |
block.queue(concurrency_count=30, max_size=90).launch(max_threads=100)
|
155 |
def restart_script_periodically():
|
156 |
while True:
|
157 |
+
time.sleep(600) # 5 minutes
|
158 |
os.execl(sys.executable, sys.executable, *sys.argv)
|
159 |
|
160 |
restart_thread = Thread(target=restart_script_periodically, daemon=True)
|