Spaces:
Running on Zero
Running on Zero
Upload folder using huggingface_hub
Browse files
app.py
CHANGED
|
@@ -547,12 +547,14 @@ def generate(
|
|
| 547 |
|
| 548 |
pred_latent = torch.cat(pred_latent_lst, dim=2)
|
| 549 |
|
| 550 |
-
#
|
| 551 |
transformer.clear_cache("pos")
|
| 552 |
streaming_vae.clear_cache()
|
|
|
|
|
|
|
| 553 |
torch.cuda.empty_cache()
|
| 554 |
|
| 555 |
-
# Decode video
|
| 556 |
pred_latent_cpu = pred_latent.cpu()
|
| 557 |
del pred_latent
|
| 558 |
torch.cuda.empty_cache()
|
|
|
|
| 547 |
|
| 548 |
pred_latent = torch.cat(pred_latent_lst, dim=2)
|
| 549 |
|
| 550 |
+
# Free VRAM before VAE decode: move transformer and text encoder to CPU
|
| 551 |
transformer.clear_cache("pos")
|
| 552 |
streaming_vae.clear_cache()
|
| 553 |
+
transformer.to("cpu")
|
| 554 |
+
text_encoder.to("cpu")
|
| 555 |
torch.cuda.empty_cache()
|
| 556 |
|
| 557 |
+
# Decode video
|
| 558 |
pred_latent_cpu = pred_latent.cpu()
|
| 559 |
del pred_latent
|
| 560 |
torch.cuda.empty_cache()
|