jervinjosh68 commited on
Commit
a29da01
·
1 Parent(s): 8bf15ec

updated app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -65,7 +65,7 @@ if not os.path.exists('weight.pth'):
65
  else:
66
  print('Specified file (weight.pth) already downloaded. Skipping this step.')
67
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
68
- state_dict = torch.load("weight.pth")
69
  model.load_state_dict(state_dict)
70
 
71
  run_gradio()
 
65
  else:
66
  print('Specified file (weight.pth) already downloaded. Skipping this step.')
67
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
68
+ state_dict = torch.load('weight.pth', map_location=torch.device(device))
69
  model.load_state_dict(state_dict)
70
 
71
  run_gradio()