Spaces:
Running
on
Zero
Running
on
Zero
ZeroGPU
#1
by
cbensimon
HF staff
- opened
app.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
from __future__ import annotations
|
2 |
|
|
|
3 |
import torch
|
4 |
from PIL import Image
|
5 |
from einops import rearrange
|
@@ -1185,6 +1186,7 @@ def cached_vision_encoder(image):
|
|
1185 |
return image_vec.to(DEVICE, dtype=DTYPE)
|
1186 |
|
1187 |
|
|
|
1188 |
def answer_question(image, question):
|
1189 |
yield "Encoding image..."
|
1190 |
|
|
|
1 |
from __future__ import annotations
|
2 |
|
3 |
+
import spaces
|
4 |
import torch
|
5 |
from PIL import Image
|
6 |
from einops import rearrange
|
|
|
1186 |
return image_vec.to(DEVICE, dtype=DTYPE)
|
1187 |
|
1188 |
|
1189 |
+
@spaces.GPU(duration=10)
|
1190 |
def answer_question(image, question):
|
1191 |
yield "Encoding image..."
|
1192 |
|