Spaces:
Runtime error
Runtime error
phenomenon1981
commited on
Commit
·
cadc7e6
1
Parent(s):
3664da8
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 |
|
@@ -151,7 +151,7 @@ with gr.Blocks() as myface:
|
|
151 |
see_prompts.click(get_prompts, inputs=[input_text], outputs=[prompt])
|
152 |
|
153 |
myface.launch(enable_queue=True, inline=True)
|
154 |
-
block.queue(concurrency_count=30, max_size=
|
155 |
def restart_script_periodically():
|
156 |
while True:
|
157 |
time.sleep(301) # 5 minutes
|
|
|
9 |
from threading import Thread
|
10 |
|
11 |
queue = Queue()
|
12 |
+
queue_threshold = 15
|
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 >= 600: # 5 minutes
|
21 |
queue.queue.clear()
|
22 |
start_time = time.time()
|
23 |
|
|
|
151 |
see_prompts.click(get_prompts, inputs=[input_text], outputs=[prompt])
|
152 |
|
153 |
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(301) # 5 minutes
|