merve HF staff commited on
Commit
2958a16
1 Parent(s): f455eeb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -9,6 +9,7 @@ import requests
9
  import torch
10
  import numpy as np
11
  import gradio as gr
 
12
 
13
  ## NLLB Inference
14
  nllb_clip_processor = CLIPProcessor.from_pretrained("openai/clip-vit-base-patch32")
@@ -73,6 +74,7 @@ def infer_siglip(image, candidate_labels):
73
  siglip_out = siglip_detector(image, candidate_labels)
74
  return postprocess_siglip(siglip_out, labels=candidate_labels)
75
 
 
76
  def infer(image, labels):
77
  st_out = infer_st(image, labels)
78
  nllb_out = nllb_clip_inference(image, labels)
 
9
  import torch
10
  import numpy as np
11
  import gradio as gr
12
+ import spaces
13
 
14
  ## NLLB Inference
15
  nllb_clip_processor = CLIPProcessor.from_pretrained("openai/clip-vit-base-patch32")
 
74
  siglip_out = siglip_detector(image, candidate_labels)
75
  return postprocess_siglip(siglip_out, labels=candidate_labels)
76
 
77
+ @spaces.GPU
78
  def infer(image, labels):
79
  st_out = infer_st(image, labels)
80
  nllb_out = nllb_clip_inference(image, labels)