multimodalart HF staff commited on
Commit
641b3df
·
verified ·
1 Parent(s): aa1e549

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -7
app.py CHANGED
@@ -50,13 +50,14 @@ def run_schnell(prompt):
50
 
51
  def run_parallel_models(prompt):
52
 
53
- with ProcessPoolExecutor(3) as e:
54
- image_dev_hyper = run_dev_hyper(prompt)
55
- image_dev_turbo = run_dev_turbo(prompt)
56
- image_schnell = run_schnell(prompt)
57
- res_dev_hyper = image_dev_hyper.result()
58
- res_dev_turbo = image_dev_turbo.result()
59
- res_schnell = image_schnell.result()
 
60
  return res_dev_hyper, res_dev_turbo, res_schnell
61
 
62
  run_parallel_models.zerogpu = True
 
50
 
51
  def run_parallel_models(prompt):
52
 
53
+ with ProcessPoolExecutor(max_workers=3) as executor:
54
+ future_dev_hyper = executor.submit(run_dev_hyper, prompt)
55
+ future_dev_turbo = executor.submit(run_dev_turbo, prompt)
56
+ future_schnell = executor.submit(run_schnell, prompt)
57
+
58
+ res_dev_hyper = future_dev_hyper.result()
59
+ res_dev_turbo = future_dev_turbo.result()
60
+ res_schnell = future_schnell.result()
61
  return res_dev_hyper, res_dev_turbo, res_schnell
62
 
63
  run_parallel_models.zerogpu = True