meghnabjayakar commited on
Commit
7407ba5
·
verified ·
1 Parent(s): 4f5a32f

final updates

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -9,8 +9,9 @@ tokenizer = BertTokenizer.from_pretrained("dmis-lab/biobert-base-cased-v1.1")
9
  model = BertForSequenceClassification.from_pretrained("dmis-lab/biobert-base-cased-v1.1", num_labels=2)
10
 
11
  # loading the pretrained weights into the model
12
- model.load_state_dict(torch.load('Bio_BERT_model.pth', map_location=torch.device('cpu')))
13
- print("Done loading the weights!")
 
14
 
15
  device = "cpu"
16
 
 
9
  model = BertForSequenceClassification.from_pretrained("dmis-lab/biobert-base-cased-v1.1", num_labels=2)
10
 
11
  # loading the pretrained weights into the model
12
+ state_dict = torch.load('Bio_BERT_model.pth', map_location=torch.device('cpu'), weights_only=True)
13
+ model.load_state_dict(state_dict)
14
+ print("Weights initialized!")
15
 
16
  device = "cpu"
17