Spaces:
Sleeping
Sleeping
Yaron Koresh
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -231,10 +231,10 @@ with gr.Blocks(theme=gr.themes.Soft(),css=css,js=js) as demo:
|
|
231 |
p2_en = translate(p2,"english")
|
232 |
|
233 |
ln = len(result)
|
234 |
-
|
235 |
-
p1s = [p1_en for _ in
|
236 |
-
p2s = [p2_en for _ in
|
237 |
-
pool = Pool(ln)
|
238 |
lst = list( pool.imap( _ret, p1s, p2s ) )
|
239 |
pool.clear()
|
240 |
return lst
|
|
|
231 |
p2_en = translate(p2,"english")
|
232 |
|
233 |
ln = len(result)
|
234 |
+
rng = range(ln)
|
235 |
+
p1s = [p1_en for _ in rng]
|
236 |
+
p2s = [p2_en for _ in rng]
|
237 |
+
pool = Pool(processes=ln)
|
238 |
lst = list( pool.imap( _ret, p1s, p2s ) )
|
239 |
pool.clear()
|
240 |
return lst
|