Spaces:
Runtime error
Runtime error
Commit
·
3a1c1bf
1
Parent(s):
f5c7e7c
app.py
CHANGED
|
@@ -126,7 +126,7 @@ pipe.to(device=DEVICE)
|
|
| 126 |
#pipe.unet = torch.compile(pipe.unet)
|
| 127 |
#pipe.vae = torch.compile(pipe.vae)
|
| 128 |
|
| 129 |
-
|
| 130 |
def generate_gpu(in_im_embs):
|
| 131 |
print('start gen')
|
| 132 |
in_im_embs = in_im_embs.to('cuda').unsqueeze(0).unsqueeze(0)
|
|
@@ -139,7 +139,7 @@ def generate_gpu(in_im_embs):
|
|
| 139 |
im_emb = im_emb.detach().to('cpu').to(torch.float32)
|
| 140 |
return output, im_emb
|
| 141 |
|
| 142 |
-
|
| 143 |
def generate(in_im_embs):
|
| 144 |
output, im_emb = generate_gpu(in_im_embs)
|
| 145 |
nsfw = maybe_nsfw(output.frames[0][len(output.frames[0])//2])
|
|
|
|
| 126 |
#pipe.unet = torch.compile(pipe.unet)
|
| 127 |
#pipe.vae = torch.compile(pipe.vae)
|
| 128 |
|
| 129 |
+
@spaces.GPU()
|
| 130 |
def generate_gpu(in_im_embs):
|
| 131 |
print('start gen')
|
| 132 |
in_im_embs = in_im_embs.to('cuda').unsqueeze(0).unsqueeze(0)
|
|
|
|
| 139 |
im_emb = im_emb.detach().to('cpu').to(torch.float32)
|
| 140 |
return output, im_emb
|
| 141 |
|
| 142 |
+
|
| 143 |
def generate(in_im_embs):
|
| 144 |
output, im_emb = generate_gpu(in_im_embs)
|
| 145 |
nsfw = maybe_nsfw(output.frames[0][len(output.frames[0])//2])
|