sunana commited on
Commit
5c0ff9c
·
1 Parent(s): 41875e9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -12,7 +12,7 @@ device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
12
 
13
  print('Number fo parameters: {}'.format(model.num_parameters()))
14
  model.to(device)
15
- model_dict = torch.load('Model_example.pth.tar')['state_dict']
16
  # save model
17
  model.load_state_dict(model_dict, strict=True)
18
  model.eval()
@@ -101,4 +101,4 @@ iface = gr.Interface(fn=process_images,
101
  article=md,
102
  examples=examples)
103
 
104
- iface.launch(debug=True, share=True)
 
12
 
13
  print('Number fo parameters: {}'.format(model.num_parameters()))
14
  model.to(device)
15
+ model_dict = torch.load('Model_example.pth.tar', map_location=device)['state_dict']
16
  # save model
17
  model.load_state_dict(model_dict, strict=True)
18
  model.eval()
 
101
  article=md,
102
  examples=examples)
103
 
104
+ iface.launch(debug=True)