Spaces:
Runtime error
Runtime error
VictorSanh
commited on
Commit
Β·
12089a1
1
Parent(s):
f20057b
add community grant
Browse files
app.py
CHANGED
@@ -6,6 +6,7 @@ from PIL import Image
|
|
6 |
import imagehash
|
7 |
import cv2
|
8 |
import os
|
|
|
9 |
|
10 |
from transformers import AutoProcessor, AutoModelForCausalLM
|
11 |
from transformers.image_utils import to_numpy_array, PILImageResampling, ChannelDimension
|
@@ -117,7 +118,7 @@ def load_sample():
|
|
117 |
return sample["image"], sample["label"], "", "", ""
|
118 |
|
119 |
|
120 |
-
|
121 |
def model_inference(
|
122 |
image,
|
123 |
):
|
|
|
6 |
import imagehash
|
7 |
import cv2
|
8 |
import os
|
9 |
+
import spaces
|
10 |
|
11 |
from transformers import AutoProcessor, AutoModelForCausalLM
|
12 |
from transformers.image_utils import to_numpy_array, PILImageResampling, ChannelDimension
|
|
|
118 |
return sample["image"], sample["label"], "", "", ""
|
119 |
|
120 |
|
121 |
+
@spaces.GPU(duration=180)
|
122 |
def model_inference(
|
123 |
image,
|
124 |
):
|