final updates
Browse files
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 |
-
|
13 |
-
|
|
|
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 |
|