Spaces:
Running
on
Zero
Running
on
Zero
ZeroGPU changes
Browse files
app.py
CHANGED
@@ -27,12 +27,10 @@ from src.pipelines.pipeline_kandinsky_subject_prior import KandinskyPriorPipelin
|
|
27 |
from diffusers import DiffusionPipeline
|
28 |
from PIL import Image
|
29 |
import random
|
|
|
30 |
|
31 |
-
__device__ = "
|
32 |
-
__dtype__ = torch.
|
33 |
-
if torch.cuda.is_available():
|
34 |
-
__device__ = "cuda"
|
35 |
-
__dtype__ = torch.float16
|
36 |
|
37 |
|
38 |
class Model:
|
@@ -85,6 +83,7 @@ class Model:
|
|
85 |
).images[0]
|
86 |
return image
|
87 |
|
|
|
88 |
def run(
|
89 |
self,
|
90 |
image: dict[str, PIL.Image.Image],
|
|
|
27 |
from diffusers import DiffusionPipeline
|
28 |
from PIL import Image
|
29 |
import random
|
30 |
+
import spaces
|
31 |
|
32 |
+
__device__ = "cuda"
|
33 |
+
__dtype__ = torch.float16
|
|
|
|
|
|
|
34 |
|
35 |
|
36 |
class Model:
|
|
|
83 |
).images[0]
|
84 |
return image
|
85 |
|
86 |
+
@spaces.GPU
|
87 |
def run(
|
88 |
self,
|
89 |
image: dict[str, PIL.Image.Image],
|