Spaces:
Running
Running
Yaron Koresh
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -29,10 +29,6 @@ def port_inc():
|
|
29 |
else:
|
30 |
os.environ["CUSTOM_PORT"]=str(int(env)+1)
|
31 |
|
32 |
-
def init_pool():
|
33 |
-
#port_inc()
|
34 |
-
print("init pool")
|
35 |
-
|
36 |
def pipe_t2i():
|
37 |
PIPE = DiffusionPipeline.from_pretrained("black-forest-labs/FLUX.1-schnell", torch_dtype=torch.bfloat16, token=os.getenv("hf_token")).to("cuda")
|
38 |
return PIPE
|
@@ -193,9 +189,9 @@ def run(p1,p2,*result):
|
|
193 |
arr = [p for _ in rng]
|
194 |
out = None
|
195 |
print("Starting pool!")
|
196 |
-
with Pool(ln
|
197 |
-
out = pool.
|
198 |
-
return list(out)
|
199 |
|
200 |
def ui():
|
201 |
with gr.Blocks(theme=gr.themes.Soft(),css=css,js=js) as demo:
|
|
|
29 |
else:
|
30 |
os.environ["CUSTOM_PORT"]=str(int(env)+1)
|
31 |
|
|
|
|
|
|
|
|
|
32 |
def pipe_t2i():
|
33 |
PIPE = DiffusionPipeline.from_pretrained("black-forest-labs/FLUX.1-schnell", torch_dtype=torch.bfloat16, token=os.getenv("hf_token")).to("cuda")
|
34 |
return PIPE
|
|
|
189 |
arr = [p for _ in rng]
|
190 |
out = None
|
191 |
print("Starting pool!")
|
192 |
+
with Pool(ln) as pool:
|
193 |
+
out = pool.map(infer,arr)
|
194 |
+
return list(out.get())
|
195 |
|
196 |
def ui():
|
197 |
with gr.Blocks(theme=gr.themes.Soft(),css=css,js=js) as demo:
|