JasonTPhillipsJr commited on
Commit
fbce538
1 Parent(s): bd74aab

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -1
app.py CHANGED
@@ -17,11 +17,19 @@ bert_model = BertModel.from_pretrained("bert-base-uncased")
17
  bert_model.eval()
18
 
19
  #SpaBERT Section
 
 
20
 
 
 
21
 
 
 
22
 
 
 
23
 
24
-
25
 
26
 
27
 
 
17
  bert_model.eval()
18
 
19
  #SpaBERT Section
20
+ data_file_path = './models/spabert/datasets/SPABERT_finetuning_data_combined.json'
21
+ pretrained_model = './models/spabert/datasets/fine-spabert-base-uncased-finetuned-osm-mn.pth'
22
 
23
+ b_model = BertForMaskedLM.from_pretrained('bert-base-uncased')
24
+ b_tokenizer = BertTokenizer.from_pretrained('bert-base-uncased')
25
 
26
+ config = SpatialBertConfig()
27
+ config.output_hidden_states = True
28
 
29
+ spaBERT_model = SpatialBertForMaskedLM(config)
30
+ spaBERT_model.load_state_dict(b_model.state_dict(), strict = False)
31
 
32
+ pre_trained_model = torch.load(pretrained_model)
33
 
34
 
35