Spaces:
Runtime error
Runtime error
Commit
·
c8055b7
1
Parent(s):
ebad6de
update app
Browse files
app.py
CHANGED
@@ -15,14 +15,14 @@ def set_seed(seed=5775709):
|
|
15 |
|
16 |
set_seed()
|
17 |
|
18 |
-
def get_pipeline(device='
|
19 |
model_id = "runwayml/stable-diffusion-v1-5"
|
20 |
#pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16, safety_checker = None, requires_safety_checker = False)
|
21 |
-
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.
|
22 |
|
23 |
# load finetuned model
|
24 |
unet_id = MODEL
|
25 |
-
unet = UNet2DConditionModel.from_pretrained(unet_id, subfolder="unet", torch_dtype=torch.
|
26 |
pipe.unet = unet
|
27 |
pipe = pipe.to(device)
|
28 |
return pipe
|
|
|
15 |
|
16 |
set_seed()
|
17 |
|
18 |
+
def get_pipeline(device='cpu'):
|
19 |
model_id = "runwayml/stable-diffusion-v1-5"
|
20 |
#pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16, safety_checker = None, requires_safety_checker = False)
|
21 |
+
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float32)
|
22 |
|
23 |
# load finetuned model
|
24 |
unet_id = MODEL
|
25 |
+
unet = UNet2DConditionModel.from_pretrained(unet_id, subfolder="unet", torch_dtype=torch.float32)
|
26 |
pipe.unet = unet
|
27 |
pipe = pipe.to(device)
|
28 |
return pipe
|