Spaces:
Runtime error
Runtime error
Commit
·
a859aee
1
Parent(s):
f93e236
Update app.py
Browse files
app.py
CHANGED
@@ -27,15 +27,6 @@ def add_random_noise(prompt, noise_level=0.07):
|
|
27 |
|
28 |
queue_length_counter = 0
|
29 |
|
30 |
-
import time
|
31 |
-
start_time = time.time()
|
32 |
-
while True:
|
33 |
-
if time.time() - start_time > 180: # 180 seconds = 3 minutes
|
34 |
-
queue.queue.clear()
|
35 |
-
start_time = time.time()
|
36 |
-
# do other stuff
|
37 |
-
time.sleep(1)
|
38 |
-
|
39 |
def send_it1(inputs, noise_level, proc1=proc1):
|
40 |
global queue_length_counter
|
41 |
prompt_with_noise = add_random_noise(inputs, noise_level)
|
@@ -172,6 +163,14 @@ with gr.Blocks() as myface:
|
|
172 |
output7=gr.Image(label="Dreamlike Diffusion 1.0")
|
173 |
output8=gr.Image(label="Dreamlike Diffusion 1.0")
|
174 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
175 |
|
176 |
run.click(send_it1, inputs=[prompt, noise_level], outputs=[output1])
|
177 |
run.click(send_it2, inputs=[prompt, noise_level], outputs=[output2])
|
|
|
27 |
|
28 |
queue_length_counter = 0
|
29 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
def send_it1(inputs, noise_level, proc1=proc1):
|
31 |
global queue_length_counter
|
32 |
prompt_with_noise = add_random_noise(inputs, noise_level)
|
|
|
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])
|