cakemus commited on
Commit
69dae79
·
1 Parent(s): 8a36720
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -15,13 +15,14 @@ import uuid
15
  import random
16
  from huggingface_hub import hf_hub_download
17
 
18
- #gradio.helpers.CACHED_FOLDER = '/data/cache'
 
19
 
20
  # Load the pipeline with authentication token
21
  pipe = StableVideoDiffusionPipeline.from_pretrained(
22
  "stabilityai/stable-video-diffusion-img2vid-xt",
23
  torch_dtype=torch.float16,
24
- variant="fp16",
25
  )
26
  pipe.to("cuda")
27
  #pipe.unet = torch.compile(pipe.unet, mode="reduce-overhead", fullgraph=True)
 
15
  import random
16
  from huggingface_hub import hf_hub_download
17
 
18
+ # Check if GPU is available
19
+ device = "cuda" if torch.cuda.is_available() else "cpu"
20
 
21
  # Load the pipeline with authentication token
22
  pipe = StableVideoDiffusionPipeline.from_pretrained(
23
  "stabilityai/stable-video-diffusion-img2vid-xt",
24
  torch_dtype=torch.float16,
25
+ variant="fp16"
26
  )
27
  pipe.to("cuda")
28
  #pipe.unet = torch.compile(pipe.unet, mode="reduce-overhead", fullgraph=True)