LuxExistentia commited on
Commit
f1eecad
·
1 Parent(s): 983448b

Fixed a bug with loading weights to cpu device

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -26,7 +26,7 @@ model_classifier = nn.Sequential(nn.Linear(512, 512),
26
  nn.GELU(),
27
  nn.Linear(512, 1))
28
  model = nn.Sequential(model, model_classifier)
29
- model.load_state_dict(state_dict=torch.load(FILE_NAME, weights_only=True))
30
 
31
  test_transform = timm.data.create_transform(input_size=224, is_training=False, interpolation="bicubic")
32
 
 
26
  nn.GELU(),
27
  nn.Linear(512, 1))
28
  model = nn.Sequential(model, model_classifier)
29
+ model.load_state_dict(state_dict=torch.load(FILE_NAME, weights_only=True, map_location=torch.device(DEVICE)))
30
 
31
  test_transform = timm.data.create_transform(input_size=224, is_training=False, interpolation="bicubic")
32