Yaron Koresh commited on
Commit
2e2dc95
·
verified ·
1 Parent(s): c510f27

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -9,9 +9,9 @@ import gradio as gr
9
  import numpy as np
10
  from lxml.html import fromstring
11
  from transformers import pipeline
12
- from torch import multiprocessing as mp, _dynamo
13
  #from pathos.multiprocessing import ProcessPool as Pool
14
- #from pathos.threading import ThreadPool as Pool
15
  #from diffusers.pipelines.flux import FluxPipeline
16
  #from diffusers.utils import export_to_gif
17
  #from huggingface_hub import hf_hub_download
@@ -138,9 +138,10 @@ def main(p1,p2,*result):
138
  ln = len(result)
139
  rng = list(range(ln))
140
  arr = [p for _ in rng]
141
- with mp.Pool(ln, initializer=init_pool) as pool:
 
142
  out = pool.imap(infer,arr)
143
- return list(out)
144
 
145
  def infer(p):
146
  p1 = p["a"]
 
9
  import numpy as np
10
  from lxml.html import fromstring
11
  from transformers import pipeline
12
+ #from torch.multiprocessing import Pool
13
  #from pathos.multiprocessing import ProcessPool as Pool
14
+ from pathos.threading import ThreadPool as Pool
15
  #from diffusers.pipelines.flux import FluxPipeline
16
  #from diffusers.utils import export_to_gif
17
  #from huggingface_hub import hf_hub_download
 
138
  ln = len(result)
139
  rng = list(range(ln))
140
  arr = [p for _ in rng]
141
+ out = None
142
+ with Pool(ln, initializer=init_pool) as pool:
143
  out = pool.imap(infer,arr)
144
+ return list(out)
145
 
146
  def infer(p):
147
  p1 = p["a"]