jiang20 commited on
Commit
bb30e9a
·
1 Parent(s): 7e89ea8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -31,7 +31,7 @@ transform_nor = transforms.Compose([transforms.ToTensor(), transforms.Resize((32
31
 
32
  def greet_backdoor(image):
33
  if image is None:
34
- model.load_state_dict(torch.load('./cifar10_badnet.pth'))
35
  return 'changed'
36
  else:
37
  image = transform_nor(image).unsqueeze(0)
 
31
 
32
  def greet_backdoor(image):
33
  if image is None:
34
+ model.load_state_dict(torch.load('./cifar10_badnet.pth', map_location=torch.device('cpu')))
35
  return 'changed'
36
  else:
37
  image = transform_nor(image).unsqueeze(0)