Spaces:
Build error
Build error
AlexKoff88
commited on
Commit
·
c49d49f
1
Parent(s):
ad178df
Update app.py
Browse files
app.py
CHANGED
@@ -2,9 +2,13 @@ import gradio as gr
|
|
2 |
from optimum.intel.openvino import OVStableDiffusionPipeline
|
3 |
from diffusers.training_utils import set_seed
|
4 |
from diffusers import DDPMScheduler, StableDiffusionPipeline
|
|
|
|
|
|
|
5 |
|
6 |
import time
|
7 |
|
|
|
8 |
def create_pipeline(name):
|
9 |
if name == "valhalla/sd-pokemon-model":
|
10 |
scheduler = DDPMScheduler(beta_start=0.00085, beta_end=0.012,
|
@@ -34,6 +38,9 @@ pipes = {
|
|
34 |
for v in pipes.values():
|
35 |
pipe = create_pipeline(v)
|
36 |
del pipe
|
|
|
|
|
|
|
37 |
|
38 |
def generate(prompt, option, seed):
|
39 |
pipe = create_pipeline(pipes[option])
|
|
|
2 |
from optimum.intel.openvino import OVStableDiffusionPipeline
|
3 |
from diffusers.training_utils import set_seed
|
4 |
from diffusers import DDPMScheduler, StableDiffusionPipeline
|
5 |
+
import gc
|
6 |
+
|
7 |
+
import subprocess
|
8 |
|
9 |
import time
|
10 |
|
11 |
+
|
12 |
def create_pipeline(name):
|
13 |
if name == "valhalla/sd-pokemon-model":
|
14 |
scheduler = DDPMScheduler(beta_start=0.00085, beta_end=0.012,
|
|
|
38 |
for v in pipes.values():
|
39 |
pipe = create_pipeline(v)
|
40 |
del pipe
|
41 |
+
gc.collect()
|
42 |
+
|
43 |
+
print((subprocess.check_output("lscpu", shell=True).strip()).decode())
|
44 |
|
45 |
def generate(prompt, option, seed):
|
46 |
pipe = create_pipeline(pipes[option])
|