Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -50,13 +50,14 @@ def run_schnell(prompt):
|
|
50 |
|
51 |
def run_parallel_models(prompt):
|
52 |
|
53 |
-
with ProcessPoolExecutor(3) as
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
|
|
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
|