Spaces:
Running
on
Zero
Running
on
Zero
test moving feature extractor output to torch device
Browse files
app.py
CHANGED
@@ -335,7 +335,7 @@ def load_img_from_URL(URL):
|
|
335 |
|
336 |
@spaces.GPU
|
337 |
def embed_img(input_image):
|
338 |
-
tokens = pipe.feature_extractor(input_image)
|
339 |
img_model = pipe.image_encoder.to(torch_device)
|
340 |
with torch.no_grad():
|
341 |
embeds = img_model(torch.tensor(tokens.pixel_values[0]).unsqueeze(0))
|
|
|
335 |
|
336 |
@spaces.GPU
|
337 |
def embed_img(input_image):
|
338 |
+
tokens = pipe.feature_extractor(input_image).to(torch_device)
|
339 |
img_model = pipe.image_encoder.to(torch_device)
|
340 |
with torch.no_grad():
|
341 |
embeds = img_model(torch.tensor(tokens.pixel_values[0]).unsqueeze(0))
|