Spaces:
Sleeping
Sleeping
root
commited on
Commit
·
ccab5f4
1
Parent(s):
b4453ae
use all threads
Browse files
app.py
CHANGED
@@ -9,6 +9,10 @@ import spaces
|
|
9 |
import torch
|
10 |
from diffusers import StableDiffusionXLPipeline, EulerAncestralDiscreteScheduler
|
11 |
|
|
|
|
|
|
|
|
|
12 |
css = '''
|
13 |
.gradio-container{max-width: 570px !important}
|
14 |
h1{text-align:center}
|
@@ -192,7 +196,7 @@ with gr.Blocks(css=css) as demo:
|
|
192 |
minimum=1,
|
193 |
maximum=35,
|
194 |
step=1,
|
195 |
-
value=
|
196 |
)
|
197 |
|
198 |
gr.Examples(
|
@@ -235,4 +239,4 @@ with gr.Blocks(css=css) as demo:
|
|
235 |
# gr.Markdown("### Image Gallery")
|
236 |
# predefined_gallery = gr.Gallery(label="Image Gallery", columns=4, show_label=False, value=load_predefined_images())
|
237 |
if __name__ == "__main__":
|
238 |
-
demo.queue(max_size=20).launch(show_api=True, share=True, server_port=7860)
|
|
|
9 |
import torch
|
10 |
from diffusers import StableDiffusionXLPipeline, EulerAncestralDiscreteScheduler
|
11 |
|
12 |
+
num_cores = os.cpu_count()
|
13 |
+
torch.set_num_threads(num_cores)
|
14 |
+
print(num_cores)
|
15 |
+
|
16 |
css = '''
|
17 |
.gradio-container{max-width: 570px !important}
|
18 |
h1{text-align:center}
|
|
|
196 |
minimum=1,
|
197 |
maximum=35,
|
198 |
step=1,
|
199 |
+
value=6,
|
200 |
)
|
201 |
|
202 |
gr.Examples(
|
|
|
239 |
# gr.Markdown("### Image Gallery")
|
240 |
# predefined_gallery = gr.Gallery(label="Image Gallery", columns=4, show_label=False, value=load_predefined_images())
|
241 |
if __name__ == "__main__":
|
242 |
+
demo.queue(max_size=20).launch(show_api=True, share=True, server_port=7860)
|