Yaron Koresh commited on
Commit
2478f2d
·
verified ·
1 Parent(s): 9f1f2bf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
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
- idxs = list(range(ln))
235
- p1s = [p1_en for _ in idxs]
236
- p2s = [p2_en for _ in idxs]
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