Spaces:
Runtime error
Runtime error
Commit
·
6b1feec
1
Parent(s):
372fe65
Update app.py
Browse files
app.py
CHANGED
@@ -151,14 +151,13 @@ with gr.Blocks() as myface:
|
|
151 |
|
152 |
myface.queue(concurrency_count=15)
|
153 |
|
154 |
-
def
|
155 |
-
start_time = time.time()
|
156 |
while True:
|
157 |
-
if
|
158 |
queue.queue.clear()
|
159 |
-
|
160 |
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
|
|
151 |
|
152 |
myface.queue(concurrency_count=15)
|
153 |
|
154 |
+
def queue_monitor():
|
|
|
155 |
while True:
|
156 |
+
if queue.qsize() >= 15:
|
157 |
queue.queue.clear()
|
158 |
+
time.sleep(120)
|
159 |
|
160 |
+
monitor_thread = Thread(target=queue_monitor)
|
161 |
+
monitor_thread.start()
|
162 |
+
|
163 |
+
myface.launch(enable_queue=True, inline=True)
|