Spaces:
Running
Running
Yaron Koresh
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -10,9 +10,9 @@ import numpy as np
|
|
10 |
from lxml.html import fromstring
|
11 |
#from transformers import pipeline
|
12 |
from torch import multiprocessing as mp
|
13 |
-
|
14 |
#from pathos.multiprocessing import ProcessPool as Pool
|
15 |
-
from pathos.threading import ThreadPool as Pool
|
16 |
#from diffusers.pipelines.flux import FluxPipeline
|
17 |
#from diffusers.utils import export_to_gif
|
18 |
#from huggingface_hub import hf_hub_download
|
@@ -83,7 +83,7 @@ def generate_random_string(length):
|
|
83 |
characters = string.ascii_letters + string.digits
|
84 |
return ''.join(random.choice(characters) for _ in range(length))
|
85 |
|
86 |
-
@spaces.GPU(duration=75
|
87 |
def Piper(name,name2,posi,neg):
|
88 |
print("starting piper")
|
89 |
|
@@ -199,7 +199,7 @@ def main():
|
|
199 |
pp1=pipe_t2i()
|
200 |
pp2=pipe_i2i()
|
201 |
|
202 |
-
mp.set_start_method("
|
203 |
|
204 |
with gr.Blocks(theme=gr.themes.Soft(),css=css,js=js) as demo:
|
205 |
with gr.Column(elem_id="col-container"):
|
|
|
10 |
from lxml.html import fromstring
|
11 |
#from transformers import pipeline
|
12 |
from torch import multiprocessing as mp
|
13 |
+
from torch.multiprocessing import Pool as Pool
|
14 |
#from pathos.multiprocessing import ProcessPool as Pool
|
15 |
+
#from pathos.threading import ThreadPool as Pool
|
16 |
#from diffusers.pipelines.flux import FluxPipeline
|
17 |
#from diffusers.utils import export_to_gif
|
18 |
#from huggingface_hub import hf_hub_download
|
|
|
83 |
characters = string.ascii_letters + string.digits
|
84 |
return ''.join(random.choice(characters) for _ in range(length))
|
85 |
|
86 |
+
@spaces.GPU(duration=75)
|
87 |
def Piper(name,name2,posi,neg):
|
88 |
print("starting piper")
|
89 |
|
|
|
199 |
pp1=pipe_t2i()
|
200 |
pp2=pipe_i2i()
|
201 |
|
202 |
+
mp.set_start_method("fork", force=True)
|
203 |
|
204 |
with gr.Blocks(theme=gr.themes.Soft(),css=css,js=js) as demo:
|
205 |
with gr.Column(elem_id="col-container"):
|