Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -3,8 +3,10 @@ import torch
|
|
3 |
from diffusers import DiffusionPipeline, DPMSolverMultistepScheduler
|
4 |
from diffusers.utils import export_to_video
|
5 |
|
|
|
|
|
6 |
# load pipeline
|
7 |
-
pipe = DiffusionPipeline.from_pretrained("damo-vilab/text-to-video-ms-1.7b", torch_dtype=torch.float16, variant="fp16")
|
8 |
pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config)
|
9 |
|
10 |
# optimize for GPU memory
|
|
|
3 |
from diffusers import DiffusionPipeline, DPMSolverMultistepScheduler
|
4 |
from diffusers.utils import export_to_video
|
5 |
|
6 |
+
device = "cuda" if torch.cuda.is_available() else "cpu"
|
7 |
+
|
8 |
# load pipeline
|
9 |
+
pipe = DiffusionPipeline.from_pretrained("damo-vilab/text-to-video-ms-1.7b", torch_dtype=torch.float16, variant="fp16").to(device)
|
10 |
pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config)
|
11 |
|
12 |
# optimize for GPU memory
|