Spaces:
Sleeping
Sleeping
Yaron Koresh
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -190,20 +190,14 @@ def run(p1,p2,*result):
|
|
190 |
print("images: "+str(ln))
|
191 |
rng = list(range(ln))
|
192 |
arr1 = [p for _ in rng]
|
193 |
-
out1 = None
|
194 |
print("Starting pool!")
|
195 |
-
|
196 |
-
|
197 |
-
pool1.close()
|
198 |
-
pool1.join()
|
199 |
-
pool1.clear()
|
200 |
arr2 = [{"a":p1_en,"b":p2_en,"c":out1[_]} for _ in rng]
|
201 |
-
out2 =
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
pool2.join()
|
206 |
-
pool2.clear()
|
207 |
return out2
|
208 |
|
209 |
def ui():
|
|
|
190 |
print("images: "+str(ln))
|
191 |
rng = list(range(ln))
|
192 |
arr1 = [p for _ in rng]
|
|
|
193 |
print("Starting pool!")
|
194 |
+
pool = Pool()
|
195 |
+
out1 = list(pool.imap(infer1,arr1))
|
|
|
|
|
|
|
196 |
arr2 = [{"a":p1_en,"b":p2_en,"c":out1[_]} for _ in rng]
|
197 |
+
out2 = list(pool2.map(infer2,arr2))
|
198 |
+
pool.close()
|
199 |
+
pool.join()
|
200 |
+
pool.clear()
|
|
|
|
|
201 |
return out2
|
202 |
|
203 |
def ui():
|