Spaces:
Runtime error
Runtime error
phenomenon1981
commited on
Commit
•
dd978c0
1
Parent(s):
39c5681
Update app.py
Browse files
app.py
CHANGED
@@ -45,38 +45,18 @@ def add_random_noise(prompt, noise_level=0.07):
|
|
45 |
|
46 |
def send_it1(inputs, noise_level, proc1=proc1):
|
47 |
prompt_with_noise = add_random_noise(inputs, noise_level)
|
48 |
-
while queue.qsize() >= queue_threshold:
|
49 |
-
time.sleep(2)
|
50 |
queue.put(prompt_with_noise)
|
51 |
-
|
52 |
-
|
53 |
-
try:
|
54 |
-
output1 = proc1(prompt_with_noise)
|
55 |
-
return output1
|
56 |
-
except:
|
57 |
-
if time.time() - start_time > 20:
|
58 |
-
return "Error: Image generation took too long. Please try again."
|
59 |
-
time.sleep(1)
|
60 |
|
61 |
def send_it2(inputs, noise_level, proc1=proc1):
|
62 |
prompt_with_noise = add_random_noise(inputs, noise_level)
|
63 |
-
while queue.qsize() >= queue_threshold:
|
64 |
-
time.sleep(2)
|
65 |
queue.put(prompt_with_noise)
|
66 |
-
|
67 |
-
|
68 |
-
try:
|
69 |
-
output2 = proc1(prompt_with_noise)
|
70 |
-
return output2
|
71 |
-
except:
|
72 |
-
if time.time() - start_time > 20:
|
73 |
-
return "Error: Image generation took too long. Please try again."
|
74 |
-
time.sleep(1)
|
75 |
|
76 |
def send_it3(inputs, noise_level, proc1=proc1):
|
77 |
prompt_with_noise = add_random_noise(inputs, noise_level)
|
78 |
-
while queue.qsize() >= queue_threshold:
|
79 |
-
time.sleep(2)
|
80 |
queue.put(prompt_with_noise)
|
81 |
output3 = proc1(prompt_with_noise)
|
82 |
return output3
|
|
|
45 |
|
46 |
def send_it1(inputs, noise_level, proc1=proc1):
|
47 |
prompt_with_noise = add_random_noise(inputs, noise_level)
|
|
|
|
|
48 |
queue.put(prompt_with_noise)
|
49 |
+
output1 = proc1(prompt_with_noise)
|
50 |
+
return output1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
|
52 |
def send_it2(inputs, noise_level, proc1=proc1):
|
53 |
prompt_with_noise = add_random_noise(inputs, noise_level)
|
|
|
|
|
54 |
queue.put(prompt_with_noise)
|
55 |
+
output2 = proc1(prompt_with_noise)
|
56 |
+
return output2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
|
58 |
def send_it3(inputs, noise_level, proc1=proc1):
|
59 |
prompt_with_noise = add_random_noise(inputs, noise_level)
|
|
|
|
|
60 |
queue.put(prompt_with_noise)
|
61 |
output3 = proc1(prompt_with_noise)
|
62 |
return output3
|