haor commited on
Commit
4001ade
·
verified ·
1 Parent(s): 3a9d0c9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -57,7 +57,7 @@ def normalized(a, axis=-1, order=2):
57
  def predict(image):
58
  model = MLP(768) # CLIP embedding dim is 768 for CLIP ViT L 14
59
  pthpath = "https://huggingface.co/haor/aesthetics/resolve/main/sac%2Blogos%2Bava1-l14-linearMSE.pth"
60
- device = "cuda" if torch.cuda.is_available() else "cpu"
61
 
62
  model.load_state_dict(torch.hub.load_state_dict_from_url(pthpath, map_location=device))
63
  model.to(device).eval()
 
57
  def predict(image):
58
  model = MLP(768) # CLIP embedding dim is 768 for CLIP ViT L 14
59
  pthpath = "https://huggingface.co/haor/aesthetics/resolve/main/sac%2Blogos%2Bava1-l14-linearMSE.pth"
60
+ device = "cpu" if torch.cuda.is_available() else "cpu"
61
 
62
  model.load_state_dict(torch.hub.load_state_dict_from_url(pthpath, map_location=device))
63
  model.to(device).eval()