Spaces:
Sleeping
Sleeping
Update main.py
Browse files
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 |
|