kd5678 commited on
Commit
9ac174a
1 Parent(s): 200468f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -1,4 +1,5 @@
1
  import os
 
2
  import gradio as gr
3
  import torch
4
  import yaml
@@ -18,6 +19,8 @@ transform = transforms.Compose([
18
  transforms.Resize((512, 512), interpolation=F.InterpolationMode.LANCZOS),
19
  ])
20
 
 
 
21
  def pref_inpainting(image,
22
  box_width_ratio,
23
  mask_random_start,
@@ -27,7 +30,6 @@ def pref_inpainting(image,
27
  config_dict= yaml.safe_load(file)
28
  config = munchify(config_dict)
29
 
30
- print('Running here .........')
31
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
32
  print(f"Current Device is {device}")
33
 
 
1
  import os
2
+ import spaces
3
  import gradio as gr
4
  import torch
5
  import yaml
 
19
  transforms.Resize((512, 512), interpolation=F.InterpolationMode.LANCZOS),
20
  ])
21
 
22
+
23
+ @spaces.GPU(duration=120)
24
  def pref_inpainting(image,
25
  box_width_ratio,
26
  mask_random_start,
 
30
  config_dict= yaml.safe_load(file)
31
  config = munchify(config_dict)
32
 
 
33
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
34
  print(f"Current Device is {device}")
35