unknown commited on
Commit
91d0a5f
·
1 Parent(s): d71c9fa

move to gpu in load_model

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -120,6 +120,12 @@ class FoleyController:
120
 
121
  self.pipeline.load_ip_adapter(fc_ckpt, subfolder='semantic', weight_name='semantic_adapter.bin', image_encoder_folder=None)
122
 
 
 
 
 
 
 
123
  gr.Info("Load Finish!")
124
  print("Load Finish!")
125
  self.loaded = True
@@ -138,13 +144,7 @@ class FoleyController:
138
  sample_step_slider,
139
  cfg_scale_slider,
140
  seed_textbox,
141
- ):
142
- # move to gpu
143
- self.time_detector.to(self.device)
144
- self.pipeline.to(self.device)
145
- self.vocoder.to(self.device)
146
- self.image_encoder.to(self.device)
147
-
148
  vision_transform_list = [
149
  torchvision.transforms.Resize((128, 128)),
150
  torchvision.transforms.CenterCrop((112, 112)),
 
120
 
121
  self.pipeline.load_ip_adapter(fc_ckpt, subfolder='semantic', weight_name='semantic_adapter.bin', image_encoder_folder=None)
122
 
123
+ # move to gpu
124
+ self.time_detector.to(self.device)
125
+ self.pipeline.to(self.device)
126
+ self.vocoder.to(self.device)
127
+ self.image_encoder.to(self.device)
128
+
129
  gr.Info("Load Finish!")
130
  print("Load Finish!")
131
  self.loaded = True
 
144
  sample_step_slider,
145
  cfg_scale_slider,
146
  seed_textbox,
147
+ ):
 
 
 
 
 
 
148
  vision_transform_list = [
149
  torchvision.transforms.Resize((128, 128)),
150
  torchvision.transforms.CenterCrop((112, 112)),