Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -11,8 +11,8 @@ import numpy as np
|
|
11 |
from accelerate import Accelerator
|
12 |
accelerator = Accelerator(cpu=True)
|
13 |
pipe = accelerator.prepare(AmusedPipeline.from_pretrained("amused/amused-512", variant=None, torch_dtype=torch.float32, use_safetensors=True))
|
14 |
-
pipe
|
15 |
-
pipe
|
16 |
apol=[]
|
17 |
def plex(prompt, fifth, twice):
|
18 |
gc.collect()
|
@@ -22,7 +22,7 @@ def plex(prompt, fifth, twice):
|
|
22 |
while nm % 32 != 0:
|
23 |
nm = random.randint(1, 4836928)
|
24 |
generator = torch.Generator(device="cpu").manual_seed(nm)
|
25 |
-
image = pipe([prompt]*fifth,
|
26 |
for a, imze in enumerate(image["images"]):
|
27 |
apol.append(imze)
|
28 |
return apol
|
|
|
11 |
from accelerate import Accelerator
|
12 |
accelerator = Accelerator(cpu=True)
|
13 |
pipe = accelerator.prepare(AmusedPipeline.from_pretrained("amused/amused-512", variant=None, torch_dtype=torch.float32, use_safetensors=True))
|
14 |
+
pipe.vqvae.to(torch.float32)
|
15 |
+
pipe.to("cpu")
|
16 |
apol=[]
|
17 |
def plex(prompt, fifth, twice):
|
18 |
gc.collect()
|
|
|
22 |
while nm % 32 != 0:
|
23 |
nm = random.randint(1, 4836928)
|
24 |
generator = torch.Generator(device="cpu").manual_seed(nm)
|
25 |
+
image = pipe([prompt]*fifth,num_inference_steps=twice)
|
26 |
for a, imze in enumerate(image["images"]):
|
27 |
apol.append(imze)
|
28 |
return apol
|