Spaces:
Potre1qw
/
Running on Zero

Freak-ppa commited on
Commit
7542834
1 Parent(s): 910380b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -27,11 +27,12 @@ sam_checkpoint = "sam_hq_vit_h.pth"
27
  model_type = "vit_h"
28
  device = "cuda"
29
  sam = sam_model_registry[model_type](checkpoint=sam_checkpoint)
30
- sam.to(device=device)
31
- predictor = SamPredictor(sam)
32
 
33
- @spaces.GPU(duration=5)
 
34
  def generate_image(prompt, image):
 
 
35
  predictor.set_image(image)
36
 
37
  prompt = json.loads(prompt)
 
27
  model_type = "vit_h"
28
  device = "cuda"
29
  sam = sam_model_registry[model_type](checkpoint=sam_checkpoint)
 
 
30
 
31
+
32
+ @spaces.GPU(duration=10)
33
  def generate_image(prompt, image):
34
+ sam.to(device=device)
35
+ predictor = SamPredictor(sam)
36
  predictor.set_image(image)
37
 
38
  prompt = json.loads(prompt)