jiang20 commited on
Commit
c6b134d
·
1 Parent(s): 7174901

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -33,12 +33,13 @@ transform_nor = transforms.Compose([transforms.ToTensor(), transforms.Resize((32
33
 
34
  def greet_backdoor(image):
35
  if image is None:
36
- if model_type == 0:
37
- model.load_state_dict(torch.load('./cifar10_badnet.pth', map_location=torch.device('cpu')))
38
- model_type = 1
39
- else:
40
- model.load_state_dict(torch.load('./cifar10_clean.pth'))
41
- model_type = 0
 
42
  return 'changed'
43
  else:
44
  image = transform_nor(image).unsqueeze(0)
 
33
 
34
  def greet_backdoor(image):
35
  if image is None:
36
+ # if model_type == 0:
37
+ # model.load_state_dict(torch.load('./cifar10_badnet.pth', map_location=torch.device('cpu')))
38
+ # model_type = 1
39
+ # else:
40
+ # model.load_state_dict(torch.load('./cifar10_clean.pth'))
41
+ # model_type = 0
42
+ model.load_state_dict(torch.load('./cifar10_badnet.pth', map_location=torch.device('cpu')))
43
  return 'changed'
44
  else:
45
  image = transform_nor(image).unsqueeze(0)