JoPmt commited on
Commit
44f0ef5
1 Parent(s): 333c77e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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 = accelerator.prepare(pipe.vqvae.to(torch.float32))
15
- pipe = pipe.to("cpu")
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, generator=generator,num_inference_steps=twice)
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