AILab-CVC / VideoCrafter

VideoCrafter2: Overcoming Data Limitations for High-Quality Video Diffusion Models
https://ailab-cvc.github.io/videocrafter2/
Other
4.49k stars 333 forks source link

cuda, mps, cpu #92

Open mattiaskjellsson opened 1 month ago

mattiaskjellsson commented 1 month ago

It seems to me that there are assumptions of using CUDA? I'm very new to python, but would it make sense to do something like this if torch.cuda.is_available(): torch.cuda.set_device(local_rank) elif torch.mps.is_available(): torch.mps.set_device(local_rank) else: torch.cpu.set_device(local_rank)

in places where currently

torch.cuda.set_device(local_rank)

is used, or have I misunderstood something?