Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
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)
|