Spaces:
Sleeping
Sleeping
Add spaces GPU decorator
Browse files
app.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
import gradio as gr
|
|
|
2 |
|
3 |
from standalone_velvet import setup_models
|
4 |
|
@@ -8,6 +9,7 @@ tokenizer = models_dict["tokenizer"]
|
|
8 |
image_feature_collator = models_dict["image_feature_collator"]
|
9 |
|
10 |
|
|
|
11 |
def run_inference(text_input, image_input):
|
12 |
image_features, image_attentions = image_feature_collator([image_input])
|
13 |
instruction_inputs = tokenizer([text_input], return_tensors="pt")
|
|
|
1 |
import gradio as gr
|
2 |
+
import spaces
|
3 |
|
4 |
from standalone_velvet import setup_models
|
5 |
|
|
|
9 |
image_feature_collator = models_dict["image_feature_collator"]
|
10 |
|
11 |
|
12 |
+
@spaces.GPU
|
13 |
def run_inference(text_input, image_input):
|
14 |
image_features, image_attentions = image_feature_collator([image_input])
|
15 |
instruction_inputs = tokenizer([text_input], return_tensors="pt")
|