mrcuddle commited on
Commit
fc982fe
·
verified ·
1 Parent(s): fe77a8e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -4,8 +4,8 @@ from diffusers import I2VGenXLPipeline
4
  from diffusers.utils import export_to_gif, load_image
5
  import tempfile
6
 
7
- # Check if CUDA is available and set the device
8
- device = "cuda" if torch.cuda.is_available() else "cpu"
9
 
10
  # Initialize the pipeline with CUDA support
11
  pipeline = I2VGenXLPipeline.from_pretrained("ali-vilab/i2vgen-xl", torch_dtype=torch.float16, variant="fp16")
 
4
  from diffusers.utils import export_to_gif, load_image
5
  import tempfile
6
 
7
+ def initialize_pipeline():
8
+ device = "cuda" if torch.cuda.is_available() else "cpu"
9
 
10
  # Initialize the pipeline with CUDA support
11
  pipeline = I2VGenXLPipeline.from_pretrained("ali-vilab/i2vgen-xl", torch_dtype=torch.float16, variant="fp16")