willsh1997 commited on
Commit
0fb993f
·
verified ·
1 Parent(s): 3941493

test moving feature extractor output to torch device

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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))