Yaron Koresh commited on
Commit
88e3d95
·
verified ·
1 Parent(s): 19ce765

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -8,7 +8,7 @@ import requests
8
  import gradio as gr
9
  import numpy as np
10
  from lxml.html import fromstring
11
- from pathos.multiprocessing import ProcessPool as Pool
12
  #from diffusers import DiffusionPipeline, AnimateDiffPipeline, MotionAdapter, EulerDiscreteScheduler
13
  from diffusers.pipelines.flux import FluxPipeline
14
  #from diffusers.utils import export_to_gif
@@ -184,7 +184,7 @@ with gr.Blocks(theme=gr.themes.Soft(),css=css,js=js) as demo:
184
  idxs = list(range(ln))
185
  p1s = [p1_en for _ in idxs]
186
  p2s = [p2_en for _ in idxs]
187
- return list(Pool(ln).amap( _ret, idxs, p1s, p2s ))
188
  run_button.click(fn=_rets,inputs=[prompt,prompt2],outputs=result)
189
 
190
  demo.queue().launch()
 
8
  import gradio as gr
9
  import numpy as np
10
  from lxml.html import fromstring
11
+ from pathos.threading import ThreadPool as Pool
12
  #from diffusers import DiffusionPipeline, AnimateDiffPipeline, MotionAdapter, EulerDiscreteScheduler
13
  from diffusers.pipelines.flux import FluxPipeline
14
  #from diffusers.utils import export_to_gif
 
184
  idxs = list(range(ln))
185
  p1s = [p1_en for _ in idxs]
186
  p2s = [p2_en for _ in idxs]
187
+ return list(Pool(ln).imap( _ret, idxs, p1s, p2s ))
188
  run_button.click(fn=_rets,inputs=[prompt,prompt2],outputs=result)
189
 
190
  demo.queue().launch()