jays009 commited on
Commit
b3f86f9
·
verified ·
1 Parent(s): aff9d06

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -7
app.py CHANGED
@@ -30,13 +30,7 @@ def load_model(model_path):
30
  )
31
  checkpoint = torch.load(model_path, map_location=torch.device("cpu"))
32
  model.load_state_dict(checkpoint['model_state_dict'])
33
-
34
- # Rename keys to match the model definition
35
- state_dict['fc.weight'] = state_dict.pop('fc.1.weight')
36
- state_dict['fc.bias'] = state_dict.pop('fc.1.bias')
37
-
38
- # Load the modified state dict
39
- model.load_state_dict(state_dict)
40
  model.eval()
41
  return model
42
 
 
30
  )
31
  checkpoint = torch.load(model_path, map_location=torch.device("cpu"))
32
  model.load_state_dict(checkpoint['model_state_dict'])
33
+
 
 
 
 
 
 
34
  model.eval()
35
  return model
36