changsr commited on
Commit
320b124
1 Parent(s): f7f0ccd

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +1 -1
main.py CHANGED
@@ -13,7 +13,7 @@ def init():
13
  tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
14
  models = loading_model("bert-base-uncased")
15
  model = BirdModel_Attention_lstm(models, True)
16
- checkpoint = torch.load("attention_lstm_pre.ckpt")
17
  model.load_state_dict(checkpoint)
18
  return model, tokenizer
19
 
 
13
  tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
14
  models = loading_model("bert-base-uncased")
15
  model = BirdModel_Attention_lstm(models, True)
16
+ checkpoint = torch.load("attention_lstm_pre.ckpt",map_location=torch.device('cpu'))
17
  model.load_state_dict(checkpoint)
18
  return model, tokenizer
19