jiangyzy commited on
Commit
5b469a0
1 Parent(s): 08f3b6b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -134,6 +134,7 @@ def prepare_data(device, input_image, x0, y0, x1, y1, polar, azimuth, text):
134
  def run_generation(sampler, model, device, input_image, x0, y0, x1, y1, polar, azimuth, text, seed):
135
  seed_everything(seed)
136
  batch = prepare_data(device, input_image, x0, y0, x1, y1, polar, azimuth, text)
 
137
 
138
  c = model.get_learned_conditioning(batch["image_cond"])
139
  c = torch.cat([c, batch["T"]], dim=-1)
@@ -185,7 +186,7 @@ def load_example(input_image, x0, y0, x1, y1, polar, azimuth, prompt):
185
  # print(type(polar))
186
  return input_image, x0, y0, x1, y1, polar, azimuth, prompt
187
 
188
- @spaces.GPU
189
  @torch.no_grad()
190
  def main(args):
191
  # load model
 
134
  def run_generation(sampler, model, device, input_image, x0, y0, x1, y1, polar, azimuth, text, seed):
135
  seed_everything(seed)
136
  batch = prepare_data(device, input_image, x0, y0, x1, y1, polar, azimuth, text)
137
+ model = model.to(device)
138
 
139
  c = model.get_learned_conditioning(batch["image_cond"])
140
  c = torch.cat([c, batch["T"]], dim=-1)
 
186
  # print(type(polar))
187
  return input_image, x0, y0, x1, y1, polar, azimuth, prompt
188
 
189
+
190
  @torch.no_grad()
191
  def main(args):
192
  # load model