Spaces:
Runtime error
Runtime error
phenomenon1981
commited on
Commit
•
01d0666
1
Parent(s):
a859aee
Update app.py
Browse files
app.py
CHANGED
@@ -26,6 +26,13 @@ def add_random_noise(prompt, noise_level=0.07):
|
|
26 |
return "".join(prompt_list)
|
27 |
|
28 |
queue_length_counter = 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
|
30 |
def send_it1(inputs, noise_level, proc1=proc1):
|
31 |
global queue_length_counter
|
@@ -163,14 +170,6 @@ with gr.Blocks() as myface:
|
|
163 |
output7=gr.Image(label="Dreamlike Diffusion 1.0")
|
164 |
output8=gr.Image(label="Dreamlike Diffusion 1.0")
|
165 |
|
166 |
-
|
167 |
-
start_time = time.time()
|
168 |
-
while True:
|
169 |
-
if time.time() - start_time > 180: # 180 seconds = 3 minutes
|
170 |
-
queue.queue.clear()
|
171 |
-
start_time = time.time()
|
172 |
-
# do other stuff
|
173 |
-
time.sleep(1)
|
174 |
|
175 |
run.click(send_it1, inputs=[prompt, noise_level], outputs=[output1])
|
176 |
run.click(send_it2, inputs=[prompt, noise_level], outputs=[output2])
|
|
|
26 |
return "".join(prompt_list)
|
27 |
|
28 |
queue_length_counter = 0
|
29 |
+
start_time = time.time()
|
30 |
+
while True:
|
31 |
+
if time.time() - start_time > 180: # 180 seconds = 3 minutes
|
32 |
+
queue.queue.clear()
|
33 |
+
start_time = time.time()
|
34 |
+
# do other stuff
|
35 |
+
time.sleep(1)
|
36 |
|
37 |
def send_it1(inputs, noise_level, proc1=proc1):
|
38 |
global queue_length_counter
|
|
|
170 |
output7=gr.Image(label="Dreamlike Diffusion 1.0")
|
171 |
output8=gr.Image(label="Dreamlike Diffusion 1.0")
|
172 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
173 |
|
174 |
run.click(send_it1, inputs=[prompt, noise_level], outputs=[output1])
|
175 |
run.click(send_it2, inputs=[prompt, noise_level], outputs=[output2])
|